Navigation Menu

Skip to content

Commit

Permalink
handle and display error output content and messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ndejong committed Apr 23, 2019
1 parent ba6e8f2 commit 4686226
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions utils/analyzer-runlocal.py
Expand Up @@ -71,22 +71,23 @@ def main(self):

timer_start = time.time()
stdout, stderr, returncode = self.shell_command(command_line)
if returncode > 0 or stderr:
self.stderr(stderr)
exit(returncode)
timer_end = time.time()

self.stderr('runtime: {}'.format(timer_end - timer_start))
self.stderr()

output_filename = os.path.join(job_path,'output' ,'output.json')
if not os.path.isfile(output_filename):
self.stderr('\nERROR: Unable to locate expected output file {}\n'.format(output_filename))
exit(1)

self.stderr()

with open(output_filename, 'r') as f:
output = f.read()

if returncode > 0 or stderr:
self.stderr(stderr)
self.stdout(output)
exit(returncode)

self.stdout(output)

def check_job_definition(self, job_definition):
Expand Down

0 comments on commit 4686226

Please sign in to comment.