mirror of
https://github.com/ansible/awx.git
synced 2026-02-21 13:10:11 -03:30
updated legacy messages
This commit is contained in:
@@ -597,7 +597,11 @@ class TowerAPIModule(TowerModule):
|
|||||||
while not result['json']['finished']:
|
while not result['json']['finished']:
|
||||||
# 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)
|
# Account for Legacy messages
|
||||||
|
if object_type is 'legacy_job_wait':
|
||||||
|
self.json_output['msg'] = 'Monitoring of Job - {1} aborted due to timeout'.format(object_name)
|
||||||
|
else:
|
||||||
|
self.json_output['msg'] = 'Monitoring of {0} - {1} aborted due to timeout'.format(object_type, object_name)
|
||||||
self.wait_output(result)
|
self.wait_output(result)
|
||||||
self.fail_json(**self.json_output)
|
self.fail_json(**self.json_output)
|
||||||
|
|
||||||
@@ -609,7 +613,11 @@ 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)
|
# Account for Legacy messages
|
||||||
|
if object_type is 'legacy_job_wait':
|
||||||
|
self.json_output['msg'] = 'Job with id {0} failed'.format(object_name)
|
||||||
|
else:
|
||||||
|
self.json_output['msg'] = 'The {0} - {1}, failed'.format(object_type, object_name)
|
||||||
self.wait_output(result)
|
self.wait_output(result)
|
||||||
self.fail_json(**self.json_output)
|
self.fail_json(**self.json_output)
|
||||||
|
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ def main():
|
|||||||
results = module.wait_on_url(
|
results = module.wait_on_url(
|
||||||
url=results['json']['url'],
|
url=results['json']['url'],
|
||||||
object_name=name,
|
object_name=name,
|
||||||
object_type='job',
|
object_type='Job',
|
||||||
timeout=timeout, interval=interval
|
timeout=timeout, interval=interval
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ def main():
|
|||||||
result = module.wait_on_url(
|
result = module.wait_on_url(
|
||||||
url=job['url'],
|
url=job['url'],
|
||||||
object_name=job_id,
|
object_name=job_id,
|
||||||
object_type='job',
|
object_type='legacy_job_wait',
|
||||||
timeout=timeout, interval=interval
|
timeout=timeout, interval=interval
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ def main():
|
|||||||
module.wait_on_url(
|
module.wait_on_url(
|
||||||
url=result['json']['url'],
|
url=result['json']['url'],
|
||||||
object_name=name,
|
object_name=name,
|
||||||
object_type='workflow_job',
|
object_type='Workflow Job',
|
||||||
timeout=timeout, interval=interval
|
timeout=timeout, interval=interval
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user