From 61287f6b364326d188cc4f254b5220b352643889 Mon Sep 17 00:00:00 2001 From: John Westcott IV Date: Wed, 25 Mar 2020 14:48:09 -0400 Subject: [PATCH] Removing old unneeded output and fixing comments --- awx_collection/plugins/modules/tower_job_wait.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/awx_collection/plugins/modules/tower_job_wait.py b/awx_collection/plugins/modules/tower_job_wait.py index 640eb1b525..96cf6a8c84 100644 --- a/awx_collection/plugins/modules/tower_job_wait.py +++ b/awx_collection/plugins/modules/tower_job_wait.py @@ -94,7 +94,6 @@ status: from ..module_utils.tower_api import TowerModule import time -import itertools def check_job(module, job_url): @@ -141,15 +140,16 @@ def main(): job_url = job['url'] # This comes from tower_cli/models/base.py from the old tower-cli - dots = itertools.cycle([0, 1, 2, 3]) interval = min_interval start = time.time() - # Poll the Ansible Tower instance for status, and print the status to the outfile (usually standard out). + # Get the initial job status from Tower, this will exit if there are any issues result = check_job(module, job_url) last_poll = time.time() timeout_check = 0 + + # Loop while the job is not yet completed while not result['finished']: # Sanity check: Have we officially timed out? # The timeout check is incremented below, so this is checking to see if we were timed out as of @@ -158,9 +158,6 @@ def main(): module.json_output['msg'] = "Monitoring aborted due to timeout" module.fail_json(**module.json_output) - # If the outfile is a TTY, print the current status. - output = '\rCurrent status: %s%s' % (result['status'], '.' * next(dots)) - # Put the process to sleep briefly. time.sleep(0.2)