mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Ability to pause pexpect output with env var
Since inventory updates don't support extra vars
This commit is contained in:
parent
5be53d4a79
commit
29b4865af8
@ -426,8 +426,14 @@ class BaseTask(Task):
|
||||
logfile = stdout_handle
|
||||
logfile_pos = logfile.tell()
|
||||
if hasattr(instance, "extra_vars_dict") and "PEXPECT_SLEEP" in instance.extra_vars_dict:
|
||||
pexpect_sleep = int(instance.extra_vars_dict['PEXPECT_SLEEP'])
|
||||
elif 'PEXPECT_SLEEP' in os.environ:
|
||||
pexpect_sleep = int(os.environ['PEXPECT_SLEEP'])
|
||||
else:
|
||||
pexpect_sleep = None
|
||||
if pexpect_sleep is not None:
|
||||
logger.info("Suspending Job Execution for QA Work")
|
||||
time.sleep(int(instance.extra_vars_dict["PEXPECT_SLEEP"]))
|
||||
time.sleep(pexpect_sleep)
|
||||
child = pexpect.spawnu(args[0], args[1:], cwd=cwd, env=env)
|
||||
child.logfile_read = logfile
|
||||
canceled = False
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user