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 2016/11/02 19:05:41 UTC

[3/4] incubator-trafficcontrol git commit: update update_riak_for_search to not error if keys are not found for a DS

update update_riak_for_search to not error if keys are not found for a DS


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

Branch: refs/heads/master
Commit: 9e5a9d3f22b4553c9686af95a612a606faf0016b
Parents: 0e0df83
Author: Dave Neuman <ne...@apache.org>
Authored: Wed Nov 2 09:24:05 2016 -0600
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Wed Nov 2 13:04:41 2016 -0600

----------------------------------------------------------------------
 traffic_ops/app/script/update_riak_for_search.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9e5a9d3f/traffic_ops/app/script/update_riak_for_search.pl
----------------------------------------------------------------------
diff --git a/traffic_ops/app/script/update_riak_for_search.pl b/traffic_ops/app/script/update_riak_for_search.pl
index cc9d184..5eb2950 100755
--- a/traffic_ops/app/script/update_riak_for_search.pl
+++ b/traffic_ops/app/script/update_riak_for_search.pl
@@ -40,6 +40,9 @@ foreach my $ds (@$dss) {
 		my $xml_id = $ds->{xmlId};
 		my $cdn = $ds->{cdnName};
 		my $record = &get_riak_record($xml_id, $to_url, $ua);
+		if (!defined($record)) {
+			next;
+		}
 		$record->{deliveryservice} = $xml_id;
 		$record->{cdn} = $cdn;
 		$record->{certificate}->{crt} = decode_base64($record->{certificate}->{crt});
@@ -117,8 +120,8 @@ sub get_riak_record {
 	my $response = $ua->get( $url );
 
 	if(!$response->is_success() || $response->code() > 400) {
-		print "Could not get ssl record for $xml_id from riak!  Response was ". $response->{_rc} . " - " . $response->{_msg} . "\n";
-		exit 1;
+		print "Could not get ssl record for $xml_id from riak!  Response was ". $response->{_rc} . " - " . $response->{_msg} . "Skipping...\n";
+		return;
 	}
 
 	my $content = decode_json($response->{_content});