trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [2/3] incubator-trafficcontrol git commit: adds cackekey support to ds profiles
Date Tue, 11 Jul 2017 17:07:29 GMT
adds cackekey support to ds profiles


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/bacc6236
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/bacc6236
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/bacc6236

Branch: refs/heads/master
Commit: bacc623653081e9eb82b302e4ebc7247f175d97b
Parents: 13b701a
Author: Derek Gelinas <derek_gelinas@cable.comcast.com>
Authored: Thu Jun 15 16:14:23 2017 +0000
Committer: Jeff Elsloo <jeffrey_elsloo@cable.comcast.com>
Committed: Tue Jul 11 11:06:52 2017 -0600

----------------------------------------------------------------------
 .../app/lib/API/Configs/ApacheTrafficServer.pm  | 25 ++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/bacc6236/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm b/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
index 8b6662c..44dc419 100644
--- a/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
+++ b/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
@@ -1924,18 +1924,27 @@ sub format_parent_info {
 	return $text;
 }
 
-sub parent_dot_config {
+sub ats_ver {
 	my $self       = shift;
 	my $server_obj = shift;
-	my $data;
-
-	my $server_type = $server_obj->type->name;
 
 	my $ats_ver =
 		$self->db->resultset('ProfileParameter')
 		->search( { 'parameter.name' => 'trafficserver', 'parameter.config_file' => 'package',
'profile.id' => $server_obj->profile->id },
 		{ prefetch => [ 'profile', 'parameter' ] } )->get_column('parameter.value')->single();
 	my $ats_major_version = substr( $ats_ver, 0, 1 );
+
+	return $ats_major_version;
+}
+
+sub parent_dot_config {
+	my $self       = shift;
+	my $server_obj = shift;
+	my $data;
+
+	my $server_type = $server_obj->type->name;
+
+	my $ats_major_version = $self->ats_ver( $server_obj );
 	my $parent_info;
 	my $text = $self->header_comment( $server_obj->host_name );
 	if ( !defined($data) ) {
@@ -2239,6 +2248,14 @@ sub build_remap_line {
 		$text .= " \@plugin=cacheurl.so \@pparam=" . $remap->{cacheurl_file};
 	}
 
+	if ( defined( $remap->{'param'}->{'cachekey.config'} ) ) {
+		print STDERR Dumper($remap->{'param'}->{'cachekey.config'});
+		$text .= " \@plugin=cachekey.so";
+		foreach my $ck_entry ( keys %{ $remap->{'param'}->{'cachekey.config'} } ) {
+			$text .= " \@pparam=--" . $ck_entry . "=" . $remap->{'param'}->{'cachekey.config'}->{$ck_entry};
+		}
+	}
+
 	# Note: should use full path here?
 	if ( defined( $remap->{regex_remap} ) && $remap->{regex_remap} ne "" ) {
 		$text .= " \@plugin=regex_remap.so \@pparam=regex_remap_" . $remap->{ds_xml_id} . ".config";


Mime
View raw message