mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 22:49:32 -02:30
Merge pull request #442 from matburt/qa_joblaunch_delay
Add a sleep step to job runs if configured
This commit is contained in:
@@ -425,6 +425,15 @@ 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:
|
||||||
|
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(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