summaryrefslogtreecommitdiff
path: root/src/leap/eip/config.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-09-12 10:32:22 +0900
committerkali <kali@leap.se>2012-09-12 10:32:22 +0900
commit99058b9f6536a3717ab82a9d77b09d5489334eb5 (patch)
tree3ad3b3c32153b6d19d7a6c2b2dd17c30becc0c65 /src/leap/eip/config.py
parent65b953117765a88ec6fb6ba9f3b36bc1434133a4 (diff)
add openvpn-verb option to cli.
Closes #534. accepts int [1-6] that get passed to openvpn invocation. We should filter out the polling "state"/"status" commands from the log if we want it to be real useful.
Diffstat (limited to 'src/leap/eip/config.py')
-rw-r--r--src/leap/eip/config.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/leap/eip/config.py b/src/leap/eip/config.py
index 833519ee..c0e17a19 100644
--- a/src/leap/eip/config.py
+++ b/src/leap/eip/config.py
@@ -48,7 +48,7 @@ def get_socket_path():
return socket_path
-def build_ovpn_options(daemon=False, socket_path=None):
+def build_ovpn_options(daemon=False, socket_path=None, **kwargs):
"""
build a list of options
to be passed in the
@@ -78,6 +78,11 @@ def build_ovpn_options(daemon=False, socket_path=None):
opts.append('--persist-tun')
opts.append('--persist-key')
+ verbosity = kwargs.get('ovpn_verbosity', None)
+ if verbosity and 1 <= verbosity <= 6:
+ opts.append('--verb')
+ opts.append("%s" % verbosity)
+
# remote
# XXX get remote from eip.json
opts.append('--remote')
@@ -136,7 +141,7 @@ def build_ovpn_options(daemon=False, socket_path=None):
def build_ovpn_command(debug=False, do_pkexec_check=True, vpnbin=None,
- socket_path=None):
+ socket_path=None, **kwargs):
"""
build a string with the
complete openvpn invocation
@@ -182,7 +187,8 @@ def build_ovpn_command(debug=False, do_pkexec_check=True, vpnbin=None,
command.append(vpn_command)
daemon_mode = not debug
- for opt in build_ovpn_options(daemon=daemon_mode, socket_path=socket_path):
+ for opt in build_ovpn_options(daemon=daemon_mode, socket_path=socket_path,
+ **kwargs):
command.append(opt)
# XXX check len and raise proper error