summaryrefslogtreecommitdiff
path: root/src/leap/eip/openvpnconnection.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-12-18 05:54:50 +0900
committerkali <kali@leap.se>2012-12-18 05:54:50 +0900
commit75057e55828accb62beef1f73364edd82a75ed30 (patch)
treec275d39177d8b2d41e89010c6b04dd3417548fc8 /src/leap/eip/openvpnconnection.py
parentf104e834c96c9ec10a465bda46ef05e87ea32516 (diff)
do not pass CA.crt to checks for https
also skip temporary errors when previous openvpn process vanishes.
Diffstat (limited to 'src/leap/eip/openvpnconnection.py')
-rw-r--r--src/leap/eip/openvpnconnection.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/leap/eip/openvpnconnection.py b/src/leap/eip/openvpnconnection.py
index 253f5056..59ba44f0 100644
--- a/src/leap/eip/openvpnconnection.py
+++ b/src/leap/eip/openvpnconnection.py
@@ -275,12 +275,16 @@ to be triggered for each one of them.
"""
check if openvpn is already running
"""
- for process in psutil.get_process_list():
- if process.name == "openvpn":
- logger.debug('an openvpn instance is already running.')
- logger.debug('attempting to stop openvpn instance.')
- if not self._stop_openvpn():
- raise eip_exceptions.OpenVPNAlreadyRunning
+ try:
+ for process in psutil.get_process_list():
+ if process.name == "openvpn":
+ logger.debug('an openvpn instance is already running.')
+ logger.debug('attempting to stop openvpn instance.')
+ if not self._stop_openvpn():
+ raise eip_exceptions.OpenVPNAlreadyRunning
+
+ except psutil.error.NoSuchProcess:
+ logger.debug('detected a process which died. passing.')
logger.debug('no openvpn instance found.')