You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by sm...@apache.org on 2018/05/08 18:56:14 UTC
[incubator-trafficcontrol] branch master updated: uses info api to
allow ORT to retain compatibility with older builds
This is an automated email from the ASF dual-hosted git repository.
smalenfant pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new e1c0109 uses info api to allow ORT to retain compatibility with older builds
e1c0109 is described below
commit e1c010922f27095b670f32ab6208afb9e9f9bc94
Author: Derek Gelinas <mr...@gmail.com>
AuthorDate: Mon May 7 18:39:06 2018 -0400
uses info api to allow ORT to retain compatibility with older builds
---
traffic_ops/bin/traffic_ops_ort.pl | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/traffic_ops/bin/traffic_ops_ort.pl b/traffic_ops/bin/traffic_ops_ort.pl
index 00ced01..f0a9af3 100755
--- a/traffic_ops/bin/traffic_ops_ort.pl
+++ b/traffic_ops/bin/traffic_ops_ort.pl
@@ -788,12 +788,24 @@ sub get_update_status {
##Some versions of Traffic Ops had the 1.3 API but did not have the use_reval_pending field. If this field is not present, exit.
if ( !defined( $upd_json->[0]->{'use_reval_pending'} ) ) {
- ( $log_level >> $ERROR ) && printf("ERROR ORT version incompatible with current version of Traffic Ops. Please upgrade to Traffic Ops 2.2.\n");
- exit 1;
+ my $info_uri = "/api/1.2/system/info.json";
+ my $info_ref = &lwp_get($info_uri);
+ if ($info_ref eq '404') {
+ ( $log_level >> $ERROR ) && printf("ERROR Unable to get status of use_reval_pending parameter. Stopping.\n");
+ exit 1;
+ }
+ if ( $info_ref =~ m/^\d{3}$/ ) {
+ ( $log_level >> $ERROR ) && print "ERROR Update URL: $info_uri returned $info_ref. Exiting, not sure what else to do.\n";
+ exit 1;
+ }
+ my $info_json = decode_json($info_ref);
+ if (defined( $info_json->{'response'}->{'parameters'}->{'use_reval_pending'} ) ) {
+ $reval_in_use = $info_json->{'response'}->{'parameters'}->{'use_reval_pending'};
+ }
+ }
+ else {
+ $reval_in_use = $upd_json->[0]->{'use_reval_pending'};
}
-
- $reval_in_use = $upd_json->[0]->{'use_reval_pending'};
-
return ($upd_json, $uri);
}
--
To stop receiving notification emails like this one, please contact
smalenfant@apache.org.