diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 90eddb1ab4..e6ea530f81 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -144,9 +144,9 @@ def mongodb_control(cmd): logger.error(err) if cmd == 'stop' and shutdown_failed: - time.sleep(30) p = subprocess.Popen('sudo mongod --shutdown -f /etc/mongod.conf', shell=True) out, err = p.communicate() + p.wait() logger.info("Shutdown command output: %s;%s" % (out, err)) @task(bind=True)