summaryrefslogtreecommitdiff
path: root/src/leap/eip/conductor.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-08-02 02:21:45 +0900
committerkali <kali@leap.se>2012-08-02 02:21:45 +0900
commit23502b72f8cd8a9ec2fd28387f7788aeef54c2d1 (patch)
tree27edd4a91505d7c5e68e694a2cada5da7d0eb8da /src/leap/eip/conductor.py
parent6e197c1353c788109df07ee6d1242a5c2327e8f9 (diff)
create config file if not exist.
also locate openvpn binary when building eip configparser defaults. implement half of feature #356
Diffstat (limited to 'src/leap/eip/conductor.py')
-rw-r--r--src/leap/eip/conductor.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/leap/eip/conductor.py b/src/leap/eip/conductor.py
index 3ce062aa..1d5e4b59 100644
--- a/src/leap/eip/conductor.py
+++ b/src/leap/eip/conductor.py
@@ -7,7 +7,8 @@ from functools import partial
import logging
from leap.util.coroutines import spawn_and_watch_process
-from leap.baseapp.config import get_config, get_vpn_stdout_mockup
+
+from leap.eip.config import get_config, get_vpn_stdout_mockup
from leap.eip.vpnwatcher import EIPConnectionStatus, status_watcher
from leap.eip.vpnmanager import OpenVPNManager, ConnectionRefusedError
@@ -39,6 +40,10 @@ class UnrecoverableError(EIPClientError):
"""
we cannot do anything about it, sorry
"""
+ # XXX we should catch this and raise
+ # to qtland, so we emit signal
+ # to translate whatever kind of error
+ # to user-friendly msg in dialog.
pass
@@ -78,7 +83,7 @@ to be triggered for each one of them.
self.autostart = True
- self._get_config()
+ self._get_or_create_config()
def _set_command_mockup(self):
"""
@@ -88,16 +93,19 @@ to be triggered for each one of them.
command, args = get_vpn_stdout_mockup()
self.command, self.args = command, args
- def _get_config(self):
+ def _get_or_create_config(self):
"""
retrieves the config options from defaults or
home file, or config file passed in command line.
"""
config = get_config(config_file=self.config_file)
self.config = config
+ import ipdb;ipdb.set_trace()
if config.has_option('openvpn', 'command'):
commandline = config.get('openvpn', 'command')
+ #XXX remove mockup from here.
+ #it was just for testing early.
if commandline == "mockup":
self._set_command_mockup()
return