mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
updated parameters and errors
This commit is contained in:
parent
49e2a3fa5a
commit
007b0d841e
@ -590,7 +590,7 @@ class TowerAPIModule(TowerModule):
|
||||
else:
|
||||
return True
|
||||
|
||||
def wait_on_url(self, object_name=None, object_type=None, url=None, timeout=None, interval=None):
|
||||
def wait_on_url(self, url, object_name, object_type, timeout=30, interval=10):
|
||||
# Grab our start time to compare against for the timeout
|
||||
start = time.time()
|
||||
result = self.get_endpoint(url)
|
||||
|
||||
@ -247,9 +247,9 @@ def main():
|
||||
|
||||
# Invoke wait function
|
||||
results = module.wait_on_url(
|
||||
url=results['json']['url'],
|
||||
object_name=name,
|
||||
object_type='job',
|
||||
url=results['json']['url'],
|
||||
timeout=timeout, interval=interval
|
||||
)
|
||||
|
||||
|
||||
@ -141,14 +141,17 @@ def main():
|
||||
|
||||
# Invoke wait function
|
||||
result = module.wait_on_url(
|
||||
url=job['url'],
|
||||
object_name=job_id,
|
||||
object_type='job',
|
||||
url=job['url'],
|
||||
timeout=timeout, interval=interval
|
||||
)
|
||||
|
||||
module.exit_json(**module.json_output)
|
||||
# Format data to keep legacy compatability.
|
||||
for k in ('id', 'status', 'elapsed', 'started', 'finished'):
|
||||
module.json_output[k] = result['json'].get(k)
|
||||
|
||||
module.exit_json(**module.json_output)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@ -179,9 +179,9 @@ def main():
|
||||
|
||||
# Invoke wait function
|
||||
module.wait_on_url(
|
||||
url=result['json']['url'],
|
||||
object_name=name,
|
||||
object_type='workflow_job',
|
||||
url=result['json']['url'],
|
||||
timeout=timeout, interval=interval
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user