summaryrefslogtreecommitdiff
path: root/src/leap/eip/config.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-08-03 10:18:50 +0900
committerkali <kali@leap.se>2012-08-03 10:18:50 +0900
commit5c34052ef9261a47947e3e03616fe34b099b9fa4 (patch)
tree0a952bf7ed1ce44b5f771260134263ad224f1373 /src/leap/eip/config.py
parent81613b2ef70e5d73b7c34eb4b78ee63189b45ab6 (diff)
stub for daemon mode; disabled by now until #383 is fixed
Diffstat (limited to 'src/leap/eip/config.py')
-rw-r--r--src/leap/eip/config.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/leap/eip/config.py b/src/leap/eip/config.py
index c632ba40..4577837a 100644
--- a/src/leap/eip/config.py
+++ b/src/leap/eip/config.py
@@ -11,7 +11,7 @@ class EIPNoPkexecAvailable(Exception):
pass
-def build_ovpn_options():
+def build_ovpn_options(daemon=False):
"""
build a list of options
to be passed in the
@@ -68,10 +68,16 @@ def build_ovpn_options():
opts.append('--config')
opts.append(ovpncnf)
+ # we cannot run in daemon mode
+ # with the current subp setting.
+ # see: https://leap.se/code/issues/383
+ #if daemon is True:
+ # opts.append('--daemon')
+
return opts
-def build_ovpn_command(config):
+def build_ovpn_command(config, debug=False):
"""
build a string with the
complete openvpn invocation
@@ -116,7 +122,9 @@ def build_ovpn_command(config):
if ovpn:
command.append(ovpn)
- for opt in build_ovpn_options():
+ daemon_mode = not debug
+
+ for opt in build_ovpn_options(daemon=daemon_mode):
command.append(opt)
# XXX check len and raise proper error
@@ -191,11 +199,3 @@ def get_config(config_file=None):
config.readfp(config_file)
return config
-
-
-def get_vpn_stdout_mockup():
- # XXX REMOVE ME
- command = "python"
- args = ["-u", "-c", ("from eip_client import fakeclient;"
- "fakeclient.write_output()")]
- return command, args