mirror of
https://github.com/ansible/awx.git
synced 2026-03-16 16:37:30 -02:30
In tower_job_wait intentionally fail module for failure
This commit is contained in:
@@ -141,6 +141,12 @@ def main():
|
||||
json_output['timeout'] = True
|
||||
except exc.NotFound as excinfo:
|
||||
fail_json = dict(msg='Unable to wait, no job_id {0} found: {1}'.format(job_id, excinfo), changed=False)
|
||||
except exc.JobFailure as excinfo:
|
||||
fail_json = dict(msg='Job with id={} failed, error: {}'.format(job_id, excinfo))
|
||||
fail_json['success'] = False
|
||||
result = job.get(job_id)
|
||||
for k in ('id', 'status', 'elapsed', 'started', 'finished'):
|
||||
fail_json[k] = result.get(k)
|
||||
except (exc.ConnectionError, exc.BadRequest, exc.AuthError) as excinfo:
|
||||
fail_json = dict(msg='Unable to wait for job: {0}'.format(excinfo), changed=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user