You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2017/06/08 15:20:31 UTC
[1/4] incubator-trafficcontrol git commit: removes extraneous entry
Repository: incubator-trafficcontrol
Updated Branches:
refs/heads/master b895cc14f -> e1a3fe500
removes extraneous entry
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/619ed08b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/619ed08b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/619ed08b
Branch: refs/heads/master
Commit: 619ed08b41ffb30a48a17bbabd2f1659e8d762b5
Parents: 826c4d6
Author: Derek Gelinas <de...@cable.comcast.com>
Authored: Wed Jun 7 12:02:28 2017 +0000
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Jun 8 09:20:03 2017 -0600
----------------------------------------------------------------------
traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/619ed08b/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 6774f7d..5ebc661 100644
--- a/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
+++ b/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
@@ -314,7 +314,6 @@ sub get_scope {
elsif ( $fname eq "hosting.config" ) { $scope = 'servers' }
elsif ( $fname eq "packages" ) { $scope = 'servers' }
elsif ( $fname eq "chkconfig" ) { $scope = 'servers' }
- elsif ( $fname eq "remap.config" && $type =~ m/^MID/ ) { $scope = 'servers' }
elsif ( $fname eq "remap.config" ) { $scope = 'servers' }
elsif ( $fname eq "12M_facts" ) { $scope = 'profiles' }
elsif ( $fname eq "50-ats.rules" ) { $scope = 'profiles' }
[3/4] incubator-trafficcontrol git commit: puts remap.config back
into servers scope
Posted by mi...@apache.org.
puts remap.config back into servers scope
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/8d1a4b4d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/8d1a4b4d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/8d1a4b4d
Branch: refs/heads/master
Commit: 8d1a4b4d1b6ead762525882b65106ba1ca6e9cb9
Parents: b895cc1
Author: Derek Gelinas <de...@cable.comcast.com>
Authored: Wed Jun 7 11:42:54 2017 +0000
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Jun 8 09:20:03 2017 -0600
----------------------------------------------------------------------
.../app/lib/API/Configs/ApacheTrafficServer.pm | 73 +++-----------------
1 file changed, 9 insertions(+), 64 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/8d1a4b4d/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 412983c..6774f7d 100644
--- a/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
+++ b/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
@@ -168,7 +168,7 @@ sub get_server_config {
elsif ( $filename eq "ip_allow.config" ) { $file_contents = $self->ip_allow_dot_config( $server_obj, $filename ); }
elsif ( $filename eq "parent.config" ) { $file_contents = $self->parent_dot_config( $server_obj, $filename ); }
elsif ( $filename eq "hosting.config" ) { $file_contents = $self->hosting_dot_config( $server_obj, $filename ); }
- elsif ( $filename eq "remap.config" ) { $file_contents = $self->server_scope_remap_dot_config( $server_obj, $filename ); }
+ elsif ( $filename eq "remap.config" ) { $file_contents = $self->remap_dot_config( $server_obj, $filename ); }
elsif ( $filename eq "packages" ) {
$file_contents = $self->get_package_versions( $server_obj, $filename );
$file_contents = encode_json($file_contents);
@@ -269,7 +269,6 @@ sub get_profile_config {
elsif ( $filename eq "logs_xml.config" ) { $file_contents = $self->logs_xml_dot_config( $profile_obj, $filename ); }
elsif ( $filename eq "plugin.config" ) { $file_contents = $self->generic_profile_config( $profile_obj, $filename ); }
elsif ( $filename eq "records.config" ) { $file_contents = $self->generic_profile_config( $profile_obj, $filename ); }
- elsif ( $filename eq "remap.config" ) { $file_contents = $self->profile_scope_remap_dot_config( $profile_obj, $filename ); }
elsif ( $filename eq "storage.config" ) { $file_contents = $self->storage_dot_config( $profile_obj, $filename ); }
elsif ( $filename eq "sysctl.conf" ) { $file_contents = $self->generic_profile_config( $profile_obj, $filename ); }
elsif ( $filename =~ /url_sig_.*\.config/ ) { $file_contents = $self->url_sig_dot_config( $profile_obj, $filename ); }
@@ -316,7 +315,7 @@ sub get_scope {
elsif ( $fname eq "packages" ) { $scope = 'servers' }
elsif ( $fname eq "chkconfig" ) { $scope = 'servers' }
elsif ( $fname eq "remap.config" && $type =~ m/^MID/ ) { $scope = 'servers' }
- elsif ( $fname eq "remap.config" ) { $scope = 'profiles' }
+ elsif ( $fname eq "remap.config" ) { $scope = 'servers' }
elsif ( $fname eq "12M_facts" ) { $scope = 'profiles' }
elsif ( $fname eq "50-ats.rules" ) { $scope = 'profiles' }
elsif ( $fname eq "astats.config" ) { $scope = 'profiles' }
@@ -2129,7 +2128,7 @@ sub parent_dot_config {
}
}
-sub server_scope_remap_dot_config {
+sub remap_dot_config {
my $self = shift;
my $server_obj = shift;
my $data;
@@ -2174,66 +2173,11 @@ sub server_scope_remap_dot_config {
foreach my $ds ( @{ $data->{dslist} } ) {
foreach my $map_from ( keys %{ $ds->{remap_line} } ) {
my $map_to = $ds->{remap_line}->{$map_from};
- $text = $self->build_remap_line( $server_obj->id, $pdata, $text, $data, $ds, $map_from, $map_to );
+ $text = $self->build_remap_line( $server_obj, $pdata, $text, $data, $ds, $map_from, $map_to );
}
foreach my $map_from ( keys %{ $ds->{remap_line2} } ) {
my $map_to = $ds->{remap_line2}->{$map_from};
- $text = $self->build_remap_line( $server_obj->id, $pdata, $text, $data, $ds, $map_from, $map_to );
- }
- }
- return $text;
-}
-
-sub profile_scope_remap_dot_config {
- my $self = shift;
- my $profile_obj = shift;
- my $data;
-
- my $pdata = $self->profile_param_data( $profile_obj->id, 'package' );
- my $text = $self->header_comment( $profile_obj->name );
- if ( !defined($data) ) {
- $data = $self->profile_ds_data($profile_obj);
- }
-
- if ( $profile_obj->name =~ m/^MID/ ) {
- my %mid_remap;
- foreach my $ds ( @{ $data->{dslist} } ) {
- if ( $ds->{type} =~ /LIVE/ && $ds->{type} !~ /NATNL/ ) {
- next; # Live local delivery services skip mids
- }
- if ( defined( $ds->{org} ) && defined( $mid_remap{ $ds->{org} } ) ) {
- next; # skip remap rules from extra HOST_REGEXP entries
- }
-
- if ( defined( $ds->{mid_header_rewrite} ) && $ds->{mid_header_rewrite} ne "" ) {
- $mid_remap{ $ds->{org} } .= " \@plugin=header_rewrite.so \@pparam=" . $ds->{mid_hdr_rw_file};
- }
- if ( $ds->{qstring_ignore} == 1 ) {
- $mid_remap{ $ds->{org} } .= " \@plugin=cacheurl.so \@pparam=cacheurl_qstring.config";
- }
- if ( defined( $ds->{cacheurl} ) && $ds->{cacheurl} ne "" ) {
- $mid_remap{ $ds->{org} } .= " \@plugin=cacheurl.so \@pparam=" . $ds->{cacheurl_file};
- }
- if ( $ds->{range_request_handling} == RRH_CACHE_RANGE_REQUEST ) {
- $mid_remap{ $ds->{org} } .= " \@plugin=cache_range_requests.so";
- }
- }
- foreach my $key ( keys %mid_remap ) {
- $text .= "map " . $key . " " . $key . $mid_remap{$key} . "\n";
- }
-
- return $text;
- }
-
- # mids don't get here.
- foreach my $ds ( @{ $data->{dslist} } ) {
- foreach my $map_from ( keys %{ $ds->{remap_line} } ) {
- my $map_to = $ds->{remap_line}->{$map_from};
- $text = $self->build_remap_line( $profile_obj->id, $pdata, $text, $data, $ds, $map_from, $map_to );
- }
- foreach my $map_from ( keys %{ $ds->{remap_line2} } ) {
- my $map_to = $ds->{remap_line2}->{$map_from};
- $text = $self->build_remap_line( $profile_obj->id, $pdata, $text, $data, $ds, $map_from, $map_to );
+ $text = $self->build_remap_line( $server_obj, $pdata, $text, $data, $ds, $map_from, $map_to );
}
}
return $text;
@@ -2241,7 +2185,7 @@ sub profile_scope_remap_dot_config {
sub build_remap_line {
my $self = shift;
- my $id = shift;
+ my $server_obj = shift;
my $pdata = shift;
my $text = shift;
my $data = shift;
@@ -2255,8 +2199,9 @@ sub build_remap_line {
}
my $dscp = $remap->{dscp};
+ my $hostname = $server_obj->host_name;
- $map_from =~ s/ccr/__HOSTNAME__/;
+ $map_from =~ s/ccr/$hostname/;
if ( defined( $pdata->{'dscp_remap'} ) ) {
$text .= "map " . $map_from . " " . $map_to . " \@plugin=dscp_remap.so \@pparam=" . $dscp;
@@ -2275,7 +2220,7 @@ sub build_remap_line {
$text .= " \@plugin=regex_remap.so \@pparam=" . $dqs_file;
}
elsif ( $remap->{qstring_ignore} == 1 ) {
- my $global_exists = $self->profile_param_value( $id, 'cacheurl.config', 'location', undef );
+ my $global_exists = $self->profile_param_value( $server_obj->profile->id, 'cacheurl.config', 'location', undef );
if ($global_exists) {
$self->app->log->debug(
"qstring_ignore == 1, but global cacheurl.config param exists, so skipping remap rename config_file=cacheurl.config parameter if you want to change"
[2/4] incubator-trafficcontrol git commit: update test
Posted by mi...@apache.org.
update test
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/826c4d68
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/826c4d68
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/826c4d68
Branch: refs/heads/master
Commit: 826c4d685482f4edcdf0d02b8bd86f0640f52c59
Parents: 8d1a4b4
Author: Derek Gelinas <de...@cable.comcast.com>
Authored: Wed Jun 7 11:59:39 2017 +0000
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Jun 8 09:20:03 2017 -0600
----------------------------------------------------------------------
traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/826c4d68/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t b/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t
index b417bbe..d5cb58f 100644
--- a/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t
+++ b/traffic_ops/app/t/api/1.2/config_files_apache_traffic_server.t
@@ -46,7 +46,7 @@ ok $t->get_ok("/api/1.2/servers/100/configfiles/ats")->status_is(200)->or( sub {
# Check server routes
ok $t->get_ok("/api/1.2/profiles/100/configfiles/ats/12M_facts")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content} } );
ok $t->get_ok("/api/1.2/servers/100/configfiles/ats/ip_allow.config")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content} } );
-ok $t->get_ok("/api/1.2/profiles/100/configfiles/ats/remap.config")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content} } );
+ok $t->get_ok("/api/1.2/servers/100/configfiles/ats/remap.config")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content} } );
ok $t->get_ok("/api/1.2/servers/100/configfiles/ats/parent.config")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content} } );
ok $t->get_ok("/api/1.2/profiles/100/configfiles/ats/cache.config")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content} } );
ok $t->get_ok("/api/1.2/servers/100/configfiles/ats/hosting.config")->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content} } );
[4/4] incubator-trafficcontrol git commit: This closes #649
Posted by mi...@apache.org.
This closes #649
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/e1a3fe50
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/e1a3fe50
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/e1a3fe50
Branch: refs/heads/master
Commit: e1a3fe5002eff94b92393d359d426bd9200189cd
Parents: 619ed08
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Thu Jun 8 09:20:21 2017 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Jun 8 09:20:21 2017 -0600
----------------------------------------------------------------------
----------------------------------------------------------------------