summaryrefslogtreecommitdiff
path: root/src/leap/eip/openvpnconnection.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-11-12 22:00:58 +0900
committerkali <kali@leap.se>2012-11-12 22:00:58 +0900
commit50ae1a415698af8aaa2fbed186a9f05037a9bfd9 (patch)
tree4b18e2ecec2773f47748a2898999fcb26e9caa89 /src/leap/eip/openvpnconnection.py
parent57bd393492fde434a1e3af60b607e8e9d757b9b3 (diff)
catch error when management interface is missing during shutdown
Diffstat (limited to 'src/leap/eip/openvpnconnection.py')
-rw-r--r--src/leap/eip/openvpnconnection.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/leap/eip/openvpnconnection.py b/src/leap/eip/openvpnconnection.py
index d7c571bc..34f1e18b 100644
--- a/src/leap/eip/openvpnconnection.py
+++ b/src/leap/eip/openvpnconnection.py
@@ -179,7 +179,12 @@ to be triggered for each one of them.
terminates openvpn child subprocess
"""
if self.subp:
- self._stop()
+ try:
+ self._stop()
+ except eip_exceptions.ConnectionRefusedError:
+ logger.warning(
+ 'unable to send sigterm signal to openvpn: '
+ 'connection refused.')
# XXX kali --
# I think this will block if child process
@@ -190,8 +195,8 @@ to be triggered for each one of them.
RETCODE = self.subp.wait()
if RETCODE:
logger.error(
- 'cannot terminate subprocess! '
- '(We might have left openvpn running)')
+ 'cannot terminate subprocess! Retcode %s'
+ '(We might have left openvpn running)' % RETCODE)
def _get_openvpn_process(self):
# plist = [p for p in psutil.get_process_list() if p.name == "openvpn"]