mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Adjusted try/except statements on process checking
This commit is contained in:
parent
e189177302
commit
2d20fbe6a5
1 changed files with 5 additions and 5 deletions
|
@ -808,14 +808,14 @@ class SignalHandlingMultiprocessingProcess(MultiprocessingProcess):
|
|||
log.debug(msg)
|
||||
if HAS_PSUTIL:
|
||||
if psutil.pid_exists(self.pid):
|
||||
process = psutil.Process(self.pid)
|
||||
if hasattr(process, 'children'):
|
||||
try:
|
||||
try:
|
||||
process = psutil.Process(self.pid)
|
||||
if hasattr(process, 'children'):
|
||||
for child in process.children(recursive=True):
|
||||
if child.is_running():
|
||||
child.terminate()
|
||||
except psutil.NoSuchProcess:
|
||||
pass
|
||||
except psutil.NoSuchProcess:
|
||||
pass
|
||||
sys.exit(salt.defaults.exitcodes.EX_OK)
|
||||
|
||||
def start(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue