diff options
author | Simon Warta <[email protected]> | 2017-04-05 18:48:35 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2017-04-07 09:10:14 +0200 |
commit | 3a586db61cfe45bb7ef91dbb0b99ac88322f4925 (patch) | |
tree | c77c8ed92cf6ad4b4f67b94db9d1821afe84e65f | |
parent | f1ff37684ae01084e115bca6ac4fad88b3980788 (diff) |
Extract ModulesChooser._validate_user_selection
-rwxr-xr-x | configure.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/configure.py b/configure.py index 05ce1a7e9..46e596851 100755 --- a/configure.py +++ b/configure.py @@ -1956,6 +1956,8 @@ class ModulesChooser(object): self._not_using_because = collections.defaultdict(set) ModulesChooser._validate_dependencies_exist(self._modules) + ModulesChooser._validate_user_selection( + self._modules, self._options.enabled_modules, self._options.disabled_modules) def _check_usable(self, module, modname): if not module.compatible_os(self._options.os): @@ -2006,18 +2008,20 @@ class ModulesChooser(object): for module in modules.values(): module.dependencies_exist(modules) + @staticmethod + def _validate_user_selection(modules, enabled_modules, disabled_modules): + for modname in enabled_modules: + if modname not in modules: + logging.error("Module not found: %s" % modname) + + for modname in disabled_modules: + if modname not in modules: + logging.warning("Disabled module not found: %s" % modname) + def choose(self): to_load = set() maybe_dep = [] - for modname in self._options.enabled_modules: - if modname not in self._modules: - logging.error("Module not found: %s" % (modname)) - - for modname in self._options.disabled_modules: - if modname not in self._modules: - logging.warning("Disabled module not found: %s" % (modname)) - for (modname, module) in self._modules.items(): usable = self._check_usable(module, modname) |