Created
July 21, 2016 18:10
-
-
Save harlowja/e2333dd3ed219b53ef44671185177c3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run_section(self, section_name): | |
raw_mods = self._read_modules(section_name) | |
mostly_mods = self._fixup_modules(raw_mods) | |
d_name = self.init.distro.name | |
skipped = [] | |
forced = [] | |
overridden = self.cfg.get('unverified_modules', []) | |
for (mod, name, _freq, _args) in mostly_mods: | |
worked_distros = set(mod.distros) | |
worked_distros.update( | |
distros.Distro.expand_osfamily(mod.osfamilies)) | |
# module does not declare 'distros' or lists this distro | |
if not worked_distros or d_name in worked_distros: | |
continue | |
if name in overridden: | |
forced.append(name) | |
else: | |
skipped.append(name) | |
if skipped: | |
LOG.info("Skipping modules %s because they are not verified " | |
"on distro '%s'. To run anyway, add them to " | |
"'unverified_modules' in config.", skipped, d_name) | |
if forced: | |
LOG.info("running unverified_modules: %s", forced) | |
return self._run_modules(mostly_mods) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment