updated parameters and errors

This commit is contained in:
sean-m-sullivan 2020-08-28 07:19:39 -05:00
parent 49e2a3fa5a
commit 007b0d841e
4 changed files with 8 additions and 5 deletions

View File

@ -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)

View File

@ -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
)

View File

@ -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()

View File

@ -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
)