mirror of
https://github.com/ansible/awx.git
synced 2026-05-15 13:27:40 -02:30
Silently ignore psutil errors when the process is already gone
During ssh CP cleanuip
This commit is contained in:
@@ -71,7 +71,10 @@ def terminate_ssh_control_masters():
|
|||||||
# Terminate then kill control master processes. Workaround older
|
# Terminate then kill control master processes. Workaround older
|
||||||
# version of psutil that may not have wait_procs implemented.
|
# version of psutil that may not have wait_procs implemented.
|
||||||
for proc in ssh_cm_procs:
|
for proc in ssh_cm_procs:
|
||||||
proc.terminate()
|
try:
|
||||||
|
proc.terminate()
|
||||||
|
except psutil.NoSuchProcess:
|
||||||
|
continue
|
||||||
procs_gone, procs_alive = psutil.wait_procs(ssh_cm_procs, timeout=5)
|
procs_gone, procs_alive = psutil.wait_procs(ssh_cm_procs, timeout=5)
|
||||||
for proc in procs_alive:
|
for proc in procs_alive:
|
||||||
proc.kill()
|
proc.kill()
|
||||||
|
|||||||
Reference in New Issue
Block a user