Skip to content

Commit

Permalink
Protect ORT from errors caused by missing data in TO.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alficles authored and limited committed Jul 5, 2018
1 parent 71972ef commit 817210e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions traffic_ops/bin/traffic_ops_ort.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 817210e

Please sign in to comment.