mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 10:11:05 -03:30
updated output
This commit is contained in:
@@ -598,7 +598,6 @@ class TowerAPIModule(TowerModule):
|
|||||||
# If we are past our time out fail with a message
|
# If we are past our time out fail with a message
|
||||||
if timeout and timeout < time.time() - start:
|
if timeout and timeout < time.time() - start:
|
||||||
self.json_output['msg'] = 'Monitoring of {0} "{1}" aborted due to timeout'.format(object_type, object_name)
|
self.json_output['msg'] = 'Monitoring of {0} "{1}" aborted due to timeout'.format(object_type, object_name)
|
||||||
# Format data to keep legacy compatability.
|
|
||||||
self.wait_output(result)
|
self.wait_output(result)
|
||||||
self.fail_json(**self.json_output)
|
self.fail_json(**self.json_output)
|
||||||
|
|
||||||
@@ -611,7 +610,6 @@ class TowerAPIModule(TowerModule):
|
|||||||
# If the job has failed, we want to raise a task failure for that so we get a non-zero response.
|
# If the job has failed, we want to raise a task failure for that so we get a non-zero response.
|
||||||
if result['json']['failed']:
|
if result['json']['failed']:
|
||||||
self.json_output['msg'] = 'The {0} "{1}" failed'.format(object_type, object_name)
|
self.json_output['msg'] = 'The {0} "{1}" failed'.format(object_type, object_name)
|
||||||
# Format data to keep legacy compatability.
|
|
||||||
self.wait_output(result)
|
self.wait_output(result)
|
||||||
self.fail_json(**self.json_output)
|
self.fail_json(**self.json_output)
|
||||||
|
|
||||||
@@ -620,6 +618,5 @@ class TowerAPIModule(TowerModule):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def wait_output(self, response):
|
def wait_output(self, response):
|
||||||
# Format data to keep legacy compatability.
|
|
||||||
for k in ('id', 'status', 'elapsed', 'started', 'finished'):
|
for k in ('id', 'status', 'elapsed', 'started', 'finished'):
|
||||||
self.json_output[k] = response['json'].get(k)
|
self.json_output[k] = response['json'].get(k)
|
||||||
|
|||||||
Reference in New Issue
Block a user