mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 18:37:36 -02:30
Add a sleep step to job runs if configured
If the extra var PEXPECT_SLEEP is given to a job then it will artificially delay the job run by that number of seconds allowing QA to hook in and cancel the job
This commit is contained in:
@@ -425,6 +425,9 @@ class BaseTask(Task):
|
|||||||
'''
|
'''
|
||||||
logfile = stdout_handle
|
logfile = stdout_handle
|
||||||
logfile_pos = logfile.tell()
|
logfile_pos = logfile.tell()
|
||||||
|
if hasattr(instance, "extra_vars_dict") and "PEXPECT_SLEEP" in instance.extra_vars_dict:
|
||||||
|
logger.info("Suspending Job Execution for QA Work")
|
||||||
|
time.sleep(int(instance.extra_vars_dict["PEXPECT_SLEEP"]))
|
||||||
child = pexpect.spawnu(args[0], args[1:], cwd=cwd, env=env)
|
child = pexpect.spawnu(args[0], args[1:], cwd=cwd, env=env)
|
||||||
child.logfile_read = logfile
|
child.logfile_read = logfile
|
||||||
canceled = False
|
canceled = False
|
||||||
|
|||||||
Reference in New Issue
Block a user