You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2018/04/25 13:31:05 UTC

[GitHub] dangogh commented on a change in pull request #2158: modifies ORT to correctly parse api 1.3 for revalidation.

dangogh commented on a change in pull request #2158: modifies ORT to correctly parse api 1.3 for revalidation.  
URL: https://github.com/apache/incubator-trafficcontrol/pull/2158#discussion_r184057210
 
 

 ##########
 File path: traffic_ops/bin/traffic_ops_ort.pl
 ##########
 @@ -783,6 +771,32 @@ sub get_print_current_client_connections {
 	( $log_level >> $DEBUG ) && print "DEBUG There are currently $current_connections connections.\n";
 }
 
+sub get_update_status {
+	my $uri     = "/api/1.3/servers/$hostname_short/update_status";
+	my $upd_ref = &lwp_get($uri);
+	if ($upd_ref eq '404') {
+		( $log_level >> $ERROR ) && printf("ERROR ORT version incompatible with current version of Traffic Ops. Please upgrade to Traffic Ops 2.2.\n");
+		exit 1;
+	}
+
+	if ( $upd_ref =~ m/^\d{3}$/ ) {
+		( $log_level >> $ERROR ) && print "ERROR Update URL: $uri returned $upd_ref. Exiting, not sure what else to do.\n";
+		exit 1;
+	}
+
 
 Review comment:
   what if it's a `500`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services