From 3aea4760141347eaa6732ee9f098b03eaa6229ce Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Fri, 20 Jan 2017 12:39:54 -0500 Subject: [PATCH] ignore invalid config file keys --- lbrynet/conf.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lbrynet/conf.py b/lbrynet/conf.py index b06fa121a..b599f094a 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -378,13 +378,16 @@ class Config(object): except (IOError, OSError) as err: log.info('%s: Failed to update settings from %s', err, path) - @staticmethod - def _fix_old_conf_file_settings(settings_dict): + def _fix_old_conf_file_settings(self, settings_dict): if 'API_INTERFACE' in settings_dict: settings_dict['api_host'] = settings_dict['API_INTERFACE'] del settings_dict['API_INTERFACE'] if 'startup_scripts' in settings_dict: del settings_dict['startup_scripts'] + for key in settings_dict.keys(): + if not self._is_valid_setting(key): + log.warning('Ignoring invalid conf file setting: %s', key) + del settings_dict[key] return settings_dict def ensure_data_dir(self):