From 50ae1a415698af8aaa2fbed186a9f05037a9bfd9 Mon Sep 17 00:00:00 2001 From: kali Date: Mon, 12 Nov 2012 22:00:58 +0900 Subject: catch error when management interface is missing during shutdown --- src/leap/eip/openvpnconnection.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') 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"] -- cgit v1.2.3