summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/cli/bitmask_cli.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2018-02-13 22:44:19 +0100
committerKali Kaneko <kali@leap.se>2018-02-15 16:36:49 +0100
commita1877f36032c5c4fd0685cda7c8843ce02a4d044 (patch)
treea3adbb5b63a86dbfc8242ef6236f5163f6c64e1e /src/leap/bitmask/cli/bitmask_cli.py
parent109dcbe31064c3f6ba96309c39277638bfc82b9e (diff)
[bug] bitmaskctl status should not start bitmaskd
-Resolves: #9244
Diffstat (limited to 'src/leap/bitmask/cli/bitmask_cli.py')
-rwxr-xr-xsrc/leap/bitmask/cli/bitmask_cli.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/leap/bitmask/cli/bitmask_cli.py b/src/leap/bitmask/cli/bitmask_cli.py
index b048bb69..57435b8d 100755
--- a/src/leap/bitmask/cli/bitmask_cli.py
+++ b/src/leap/bitmask/cli/bitmask_cli.py
@@ -146,10 +146,18 @@ def execute():
cli.data = ['core', 'version']
args = None if '--noverbose' in sys.argv else ['--verbose']
+ def status_timeout(args):
+ raise RuntimeError('bitmaskd is not running')
+
+ if 'status' in sys.arv:
+ timeout_fun = status_timeout
+ else:
+ timeout_fun = cli.start
+
try:
yield cli._send(
timeout=0.1, printer=_null_printer,
- errb=lambda: cli.start(args))
+ errb=lambda: timeout_fun(args))
except Exception, e:
print(Fore.RED + "ERROR: " + Fore.RESET +
"%s" % str(e))