You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by jv...@apache.org on 2017/02/27 17:16:58 UTC

[15/20] incubator-trafficcontrol git commit: remove unneeded scope parameter lookup and logic

remove unneeded scope parameter lookup and logic


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

Branch: refs/heads/master
Commit: 3fa46b3572c1353eefb0d5c5c60146da31197bc8
Parents: 7bd7373
Author: Derek Gelinas <de...@cable.comcast.com>
Authored: Mon Jan 23 13:30:17 2017 -0500
Committer: Jan van Doorn <jv...@apache.org>
Committed: Mon Feb 27 16:57:46 2017 +0000

----------------------------------------------------------------------
 traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/3fa46b35/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 a6aab98..95aba5a 100644
--- a/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
+++ b/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
@@ -75,7 +75,7 @@ sub get_config_metadata {
 
 		%condition = (
 			'profile_parameters.profile' => $data_obj->{'profile'}->{'id'},
-			-or                          => [ 'name' => 'location', 'name' => 'scope' ]
+			-or                          => [ 'name' => 'location' ]
 		);
 		my $rs_param = $self->db->resultset('Parameter')->search( \%condition, { join => 'profile_parameters' } );
 		while ( my $param = $rs_param->next ) {
@@ -86,9 +86,7 @@ sub get_config_metadata {
 	}
 
 	foreach my $config_file ( keys $data_obj->{'config_files'} ) {
-		if ( !defined( $data_obj->{'config_files'}->{$config_file}->{'scope'} ) ) {
-			$data_obj->{'config_files'}->{$config_file}->{'scope'} = $self->get_scope($config_file);
-		}
+		$data_obj->{'config_files'}->{$config_file}->{'scope'} = $self->get_scope($config_file);
 	}
 
 	my $file_contents = encode_json($data_obj);
@@ -369,9 +367,6 @@ sub param_data {
 		if ( $row->parameter->name eq "location" ) {
 			next;
 		}
-		if ( $row->parameter->name eq "scope" ) {
-			next;
-		}
 		my $value = $row->parameter->value;
 
 		# some files have multiple lines with the same key... handle that with param id.
@@ -400,9 +395,6 @@ sub profile_param_data {
 		if ( $row->parameter->name eq "location" ) {
 			next;
 		}
-		if ( $row->parameter->name eq "scope" ) {
-			next;
-		}
 		my $value = $row->parameter->value;
 
 		# some files have multiple lines with the same key... handle that with param id.