trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dewr...@apache.org
Subject [3/3] incubator-trafficcontrol git commit: add some sorting to parent config and metadata
Date Tue, 09 May 2017 17:58:58 GMT
add some sorting to parent config and metadata


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

Branch: refs/heads/master
Commit: 8f86419e77e0fcf787c66fb678502048b91bd687
Parents: bc4ce95
Author: Derek Gelinas <derek_gelinas@cable.comcast.com>
Authored: Mon May 8 09:38:44 2017 -0400
Committer: Dewayne Richardson <dewrich@apache.org>
Committed: Tue May 9 11:58:49 2017 -0600

----------------------------------------------------------------------
 .../app/lib/API/Configs/ApacheTrafficServer.pm        | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/8f86419e/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 3eff576..ede4ffb 100644
--- a/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
+++ b/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
@@ -120,7 +120,7 @@ sub get_config_metadata {
 		$config_file_obj->{$config_file}->{'scope'} = $scope;
 	}
 
-	foreach my $config_file ( keys %{ $config_file_obj } ) {
+	foreach my $config_file ( sort keys %{ $config_file_obj } ) {
 		push ( @config_files, $config_file_obj->{$config_file} );
 	}
 
@@ -1938,7 +1938,7 @@ sub parent_dot_config {
 	}
 	if ( $server_type =~ m/^MID/ ) {
 		my @unique_origins;
-		foreach my $ds ( @{ $data->{dslist} } ) {
+		foreach my $ds ( sort @{ $data->{dslist} } ) {
 			my $xml_id                             = $ds->{ds_xml_id};
 			my $origin_shield                      = $ds->{origin_shield};
 			my $multi_site_origin                  = $ds->{multi_site_origin} || 0;
@@ -2031,7 +2031,7 @@ sub parent_dot_config {
 		$parent_info = $self->parent_data($server_obj);
 		my %done = ();
 
-		foreach my $ds ( @{ $data->{dslist} } ) {
+		foreach my $ds ( sort @{ $data->{dslist} } ) {
 			my $org = $ds->{org};
 			next if !defined $org || $org eq "";
 			next if $done{$org};
@@ -2071,12 +2071,12 @@ sub parent_dot_config {
 				}
 				my %seen;
 				@parent_info = grep { !$seen{$_}++ } @parent_info;
-				my $parents = 'parent="' . join( '', @parent_info ) . '"';
+				my $parents = 'parent="' . join( '', sort @parent_info ) . '"';
 				my $secparents = '';
 				if ( scalar @secondary_parent_info > 0 ) {
 					my %seen;
 					@secondary_parent_info = grep { !$seen{$_}++ } @secondary_parent_info;
-					$secparents = 'secondary_parent="' . join( '', @secondary_parent_info ) . '"';
+					$secparents = 'secondary_parent="' . join( '', sort @secondary_parent_info ) . '"';
 				}
 				my $round_robin = 'round_robin=consistent_hash';
 				my $go_direct   = 'go_direct=false';
@@ -2099,7 +2099,7 @@ sub parent_dot_config {
 			my %seen;
 			@parent_info = grep { !$seen{$_}++ } @parent_info;
 			$text .= "dest_domain=.";
-			$text .= " parent=\"" . join( '', @parent_info ) . "\"";
+			$text .= " parent=\"" . join( '', sort @parent_info ) . "\"";
 			$text .= " round_robin=consistent_hash go_direct=false";
 		}
 		else {    # default to old situation.
@@ -2110,7 +2110,7 @@ sub parent_dot_config {
 			}
 			my %seen;
 			@parent_info = grep { !$seen{$_}++ } @parent_info;
-			$text .= " parent=\"" . join( '', @parent_info ) . "\"";
+			$text .= " parent=\"" . join( '', sort @parent_info ) . "\"";
 			$text .= " round_robin=urlhash go_direct=false";
 		}
 


Mime
View raw message