Filter out in get_plugins the special configuration fields not associated with plugins

This commit is contained in:
Fabio Manganiello 2019-12-01 23:53:14 +01:00
parent d38746d278
commit 346b1be924

View file

@ -118,6 +118,16 @@ class Config(object):
self._init_constants() self._init_constants()
self._init_components() self._init_components()
@staticmethod
def _is_special_token(token):
return token == 'main.db' or \
token == 'token' or \
token == 'token_hash' or \
token == 'logging' or \
token == 'workdir' or \
token == 'device_id' or \
token == 'switches' or \
token == 'environment'
def _read_config_file(self, cfgfile): def _read_config_file(self, cfgfile):
cfgfile_dir = os.path.dirname(os.path.abspath( cfgfile_dir = os.path.dirname(os.path.abspath(
@ -168,7 +178,7 @@ class Config(object):
'_async': _async, '_async': _async,
'actions': self._config[key] 'actions': self._config[key]
} }
else: elif not self._is_special_token(key):
self.plugins[key] = self._config[key] self.plugins[key] = self._config[key]
def _init_constants(self): def _init_constants(self):