diff --git a/zuul/executor/server.py b/zuul/executor/server.py index 62b97161bd..0e56656cc6 100644 --- a/zuul/executor/server.py +++ b/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)