Don't traceback if the process is no longer running.

This commit is contained in:
Pedro Algarvio 2016-05-10 14:05:32 +01:00
parent e1e1aeb3d7
commit 177d9c4ead
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -14,6 +14,7 @@ import copy
import json
import time
import stat
import errno
import signal
import shutil
import pprint
@ -401,7 +402,11 @@ class SaltDaemonScriptBase(SaltScriptBase):
time.sleep(0.125)
except (SystemExit, KeyboardInterrupt):
# Let's close the terminal now that we're done with it
terminal.send_signal(signal.SIGTERM)
try:
terminal.send_signal(signal.SIGTERM)
except OSError as exc:
if exc.errno != errno.ESRCH:
raise
terminal.communicate()
self.exitcode = terminal.returncode
try: