You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2017/04/26 14:59:27 UTC

[2/3] incubator-trafficcontrol git commit: Fixed and issue where a search for DSs was using a profile ID instead of cdn_id

Fixed and issue where a search for DSs was using a profile ID instead of cdn_id

(cherry picked from commit 3f6f1cc17befc970bc0bf5cff8ff5023bd48c27c)


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

Branch: refs/heads/master
Commit: 30333b3cb4e28d2c503fda3df44cf494b1bb8225
Parents: 47368bc
Author: David Neuman <da...@gmail.com>
Authored: Tue Apr 25 15:00:09 2017 -0600
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Wed Apr 26 08:45:05 2017 -0600

----------------------------------------------------------------------
 traffic_ops/app/lib/API/Cdn.pm            | 11 ++++-------
 traffic_ops/app/lib/MojoPlugins/Server.pm |  3 ---
 2 files changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/30333b3c/traffic_ops/app/lib/API/Cdn.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Cdn.pm b/traffic_ops/app/lib/API/Cdn.pm
index 9fa1fb7..03d7671 100644
--- a/traffic_ops/app/lib/API/Cdn.pm
+++ b/traffic_ops/app/lib/API/Cdn.pm
@@ -1089,7 +1089,6 @@ sub dnssec_keys_refresh {
 
 	# fork and daemonize so we can avoid blocking
 	my $rc = $self->fork_and_daemonize();
-
 	if ( $rc < 0 ) {
 		my $error = "Unable to fork_and_daemonize to check DNSSEC keys for refresh in the background";
 		$self->app->log->fatal($error);
@@ -1109,6 +1108,7 @@ sub refresh_keys {
 	my $self       = shift;
 	my $is_updated = 0;
 	my $error_message;
+	$self->app->log->debug("Starting refresh of DNSSEC keys");
 	my $rs_data = $self->db->resultset("Cdn")->search( {}, { order_by => "name" } );
 
 	while ( my $row = $rs_data->next ) {
@@ -1195,7 +1195,7 @@ sub refresh_keys {
 			}
 
 			#get DeliveryServices for CDN
-			my %search = ( profile => $profile_id );
+			my %search = ( cdn_id => $row->id );
 			my @ds_rs = $self->db->resultset('Deliveryservice')->search( \%search );
 			foreach my $ds (@ds_rs) {
 				if (   $ds->type->name !~ m/^HTTP/
@@ -1240,16 +1240,13 @@ sub refresh_keys {
 					#update is_updated param
 					$is_updated = 1;
 				}
-
 				#if keys do exist, check expiration
 				else {
 					my $ksk = $ds_keys->{ksk};
 					foreach my $krecord (@$ksk) {
 						my $kstatus = $krecord->{status};
-						if ( $kstatus eq 'new' ) {    #ignore anything other than the 'new' record
-							                          #check if expired
+						if ( $kstatus eq 'new' ) {
 							if ( $krecord->{expirationDate} < $key_expiration ) {
-
 								#if expired create new keys
 								$self->app->log->info("The KSK keys for $xml_id are expired!");
 								my $effective_date = $krecord->{expirationDate} - ( $dnskey_ttl * $dnskey_effective_multiplier );
@@ -1282,7 +1279,6 @@ sub refresh_keys {
 			}
 
 			if ( $is_updated == 1 ) {
-
 				# #convert hash to json and store in Riak
 				my $json_data = encode_json($keys);
 				$response_container = $self->riak_put( "dnssec", $cdn_name, $json_data );
@@ -1296,6 +1292,7 @@ sub refresh_keys {
 			}
 		}
 	}
+	$self->app->log->debug("Done refreshing DNSSEC keys");
 }
 
 sub regen_expired_keys {

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/30333b3c/traffic_ops/app/lib/MojoPlugins/Server.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/MojoPlugins/Server.pm b/traffic_ops/app/lib/MojoPlugins/Server.pm
index 139194e..bbe1df0 100755
--- a/traffic_ops/app/lib/MojoPlugins/Server.pm
+++ b/traffic_ops/app/lib/MojoPlugins/Server.pm
@@ -44,9 +44,6 @@ sub register {
 			my $helper_class       = shift || confess("Supply a Helper 'class'");
 			my $method_function    = shift || confess("Supply a Helper class 'method'");
 			my $schema_result_file = shift || confess("Supply a schema result file, ie: 'InfluxDBHostsOnline'");
-
-			$self->app->log->debug("\n\n" . $schema_result_file . "\n\n");
-
 			my $response;
 			my $active_server = $active_server_for{$schema_result_file};
 			my @rs = randomize_online_servers( $self, $schema_result_file );