You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by fr...@apache.org on 2018/07/05 18:37:20 UTC
[trafficcontrol] branch master updated: Protect ORT from errors
caused by missing data in TO.
This is an automated email from the ASF dual-hosted git repository.
friede pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 817210e Protect ORT from errors caused by missing data in TO.
817210e is described below
commit 817210e85821ba4755c2e9e2158a62852b764078
Author: Chris Lemmons <al...@gmail.com>
AuthorDate: Fri Mar 30 11:20:38 2018 -0600
Protect ORT from errors caused by missing data in TO.
If a required file is not configured with a location parameter, ORT is
still attempting to process it, despite the fact that there is no file
name to process. This displays lots of errors that don't clearly
indicate what is happening or to which file it is happening. This error
message documents the problematic file and prevents its processing so
that things can continue, just without that file.
---
traffic_ops/bin/traffic_ops_ort.pl | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/traffic_ops/bin/traffic_ops_ort.pl b/traffic_ops/bin/traffic_ops_ort.pl
index a753260..34875bb 100755
--- a/traffic_ops/bin/traffic_ops_ort.pl
+++ b/traffic_ops/bin/traffic_ops_ort.pl
@@ -350,6 +350,10 @@ sub process_cfg_file {
( $log_level >> $INFO ) && print "\nINFO: ======== Start processing config file: $cfg_file ========\n";
my $config_dir = $cfg_file_tracker->{$cfg_file}->{'location'};
+ if (!$config_dir) {
+ ( $log_level >> $ERROR ) && print "ERROR No location information for $cfg_file.\n";
+ return $CFG_FILE_NOT_PROCESSED;
+ }
$uri = &set_uri($cfg_file);