Catch ProcessLookupError when updating iouyap config. Fixes #255.

This commit is contained in:
Jeremy 2015-07-27 11:40:01 -06:00
parent 5b0c36c0d6
commit 2ed0ef770e

View File

@ -928,7 +928,10 @@ class IOUVM(BaseVM):
port_number=port_number)) port_number=port_number))
if self.is_iouyap_running(): if self.is_iouyap_running():
self._update_iouyap_config() self._update_iouyap_config()
try:
os.kill(self._iouyap_process.pid, signal.SIGHUP) os.kill(self._iouyap_process.pid, signal.SIGHUP)
except ProcessLookupError:
log.error("Could not update iouyap configuration: process (PID={}) not found".format(self._iouyap_process.pid))
def adapter_remove_nio_binding(self, adapter_number, port_number): def adapter_remove_nio_binding(self, adapter_number, port_number):
""" """
@ -960,8 +963,10 @@ class IOUVM(BaseVM):
port_number=port_number)) port_number=port_number))
if self.is_iouyap_running(): if self.is_iouyap_running():
self._update_iouyap_config() self._update_iouyap_config()
try:
os.kill(self._iouyap_process.pid, signal.SIGHUP) os.kill(self._iouyap_process.pid, signal.SIGHUP)
except ProcessLookupError:
log.error("Could not update iouyap configuration: process (PID={}) not found".format(self._iouyap_process.pid))
return nio return nio
@property @property
@ -1244,7 +1249,10 @@ class IOUVM(BaseVM):
if self.is_iouyap_running(): if self.is_iouyap_running():
self._update_iouyap_config() self._update_iouyap_config()
try:
os.kill(self._iouyap_process.pid, signal.SIGHUP) os.kill(self._iouyap_process.pid, signal.SIGHUP)
except ProcessLookupError:
log.error("Could not update iouyap configuration: process (PID={}) not found".format(self._iouyap_process.pid))
@asyncio.coroutine @asyncio.coroutine
def stop_capture(self, adapter_number, port_number): def stop_capture(self, adapter_number, port_number):
@ -1277,4 +1285,7 @@ class IOUVM(BaseVM):
port_number=port_number)) port_number=port_number))
if self.is_iouyap_running(): if self.is_iouyap_running():
self._update_iouyap_config() self._update_iouyap_config()
try:
os.kill(self._iouyap_process.pid, signal.SIGHUP) os.kill(self._iouyap_process.pid, signal.SIGHUP)
except ProcessLookupError:
log.error("Could not update iouyap configuration: process (PID={}) not found".format(self._iouyap_process.pid))