diff options
author | Ruben Pollan <meskio@sindominio.net> | 2017-05-02 11:25:50 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-05-02 11:25:50 +0200 |
commit | 1d69d683323733eae3b0230938cf948741e1dba9 (patch) | |
tree | d9c0718616958532ea3d8ce4465ea9c1dde6d554 /src/leap/bitmask | |
parent | 2ec7cc559846327439ba4c44dec0c3507d0d703e (diff) |
[bug] set a non-None value for configuration defaults
None is recognized as not-default and gives an error if the
searched config value is not present in the config file. This was
provoking an error with manhole not being configured.
Diffstat (limited to 'src/leap/bitmask')
-rw-r--r-- | src/leap/bitmask/core/service.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/leap/bitmask/core/service.py b/src/leap/bitmask/core/service.py index 314c8899..8595fceb 100644 --- a/src/leap/bitmask/core/service.py +++ b/src/leap/bitmask/core/service.py @@ -85,9 +85,9 @@ class BitmaskBackend(configurable.ConfigurableService): return self.get_config('services', service, False, boolean=True) def with_manhole(): - user = self.get_config('manhole', 'user', None) - passwd = self.get_config('manhole', 'passwd', None) - port = self.get_config('manhole', 'port', None) + user = self.get_config('manhole', 'user', '') + passwd = self.get_config('manhole', 'passwd', '') + port = self.get_config('manhole', 'port', manhole.PORT) if user and passwd: conf = {'user': user, 'passwd': passwd, 'port': port} return conf @@ -116,7 +116,7 @@ class BitmaskBackend(configurable.ConfigurableService): on_start(self._init_websockets) manholecfg = with_manhole() - if manhole: + if manholecfg: on_start(self._init_manhole, manholecfg) def _touch_token_file(self): @@ -227,10 +227,7 @@ class BitmaskBackend(configurable.ConfigurableService): return service def _init_manhole(self, cfg): - try: - port = int(cfg.get('port')) - except ValueError: - port = manhole.PORT + port = cfg['port'] user, passwd = cfg['user'], cfg['passwd'] sshFactory = manhole.getManholeFactory( {'core': self}, user, passwd) |