Browse Source

Add a message to the job log on unexpected exceptions

We only get messages in the debug log on unexpected exceptions. Add
a message to the job log so that people can know there was a problem.

Change-Id: I4cb6c5d22724b55c265577dffa581a3c8e74ec25
changes/97/504097/2
Monty Taylor 5 years ago
parent
commit
d6d9144a0e
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
  1. 14
      zuul/executor/server.py

14
zuul/executor/server.py

@ -1620,6 +1620,20 @@ class AnsibleJob(object):
job_output.write("{now} | {line}\n".format(
now=datetime.datetime.now(),
line=line.decode('utf-8').rstrip()))
elif ret == 250:
# Unexpected error from ansible
with open(self.jobdir.job_output_file, 'a') as job_output:
job_output.write("{now} | UNEXPECTED ANSIBLE ERROR\n".format(
now=datetime.datetime.now()))
found_marker = False
for line in syntax_buffer:
if line.startswith('ERROR! Unexpected Exception'):
found_marker = True
if not found_marker:
continue
job_output.write("{now} | {line}\n".format(
now=datetime.datetime.now(),
line=line.decode('utf-8').rstrip()))
return (self.RESULT_NORMAL, ret)

Loading…
Cancel
Save