mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Updated for review comments
This commit is contained in:
parent
68c29af9ed
commit
2e3ca43e0d
1 changed files with 3 additions and 3 deletions
|
@ -807,15 +807,15 @@ class SignalHandlingMultiprocessingProcess(MultiprocessingProcess):
|
|||
msg += '. Exiting'
|
||||
log.debug(msg)
|
||||
if HAS_PSUTIL:
|
||||
for process in psutil.process_iter():
|
||||
if process == self.pid and hasattr(process, 'children'):
|
||||
if psutil.pid_exists(self.pid):
|
||||
process = psutil.Process(self.pid)
|
||||
if hasattr(process, 'children'):
|
||||
try:
|
||||
for child in process.children(recursive=True):
|
||||
if child.is_running():
|
||||
child.terminate()
|
||||
except psutil.NoSuchProcess:
|
||||
pass
|
||||
break
|
||||
sys.exit(salt.defaults.exitcodes.EX_OK)
|
||||
|
||||
def start(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue