def _fixup_modules(self, raw_mods):
     mostly_mods = []
     for raw_mod in raw_mods:
         raw_name = raw_mod["mod"]
         freq = raw_mod.get("freq")
         run_args = raw_mod.get("args") or []
         mod_name = config.form_module_name(raw_name)
         if not mod_name:
             continue
         if freq and freq not in FREQUENCIES:
             LOG.warning(
                 "Config specified module %s has an unknown frequency %s",
                 raw_name,
                 freq,
             )
             # Reset it so when ran it will get set to a known value
             freq = None
         mod_locs, looked_locs = importer.find_module(
             mod_name, ["", type_utils.obj_name(config)], ["handle"]
         )
         if not mod_locs:
             LOG.warning(
                 "Could not find module named %s (searched %s)",
                 mod_name,
                 looked_locs,
             )
             continue
         mod = config.fixup_module(importer.import_module(mod_locs[0]))
         mostly_mods.append([mod, raw_name, freq, run_args])
     return mostly_mods
Example #2
0
 def _fixup_modules(self, raw_mods):
     mostly_mods = []
     for raw_mod in raw_mods:
         raw_name = raw_mod["mod"]
         freq = raw_mod.get("freq")
         run_args = raw_mod.get("args") or []
         mod_name = config.form_module_name(raw_name)
         if not mod_name:
             continue
         if freq and freq not in FREQUENCIES:
             LOG.warn(("Config specified module %s" " has an unknown frequency %s"), raw_name, freq)
             # Reset it so when ran it will get set to a known value
             freq = None
         mod_locs, looked_locs = importer.find_module(mod_name, ["", type_utils.obj_name(config)], ["handle"])
         if not mod_locs:
             LOG.warn("Could not find module named %s (searched %s)", mod_name, looked_locs)
             continue
         mod = config.fixup_module(importer.import_module(mod_locs[0]))
         mostly_mods.append([mod, raw_name, freq, run_args])
     return mostly_mods
Example #3
0
 def _fixup_modules(self, raw_mods):
     mostly_mods = []
     for raw_mod in raw_mods:
         raw_name = raw_mod['mod']
         freq = raw_mod.get('freq')
         run_args = raw_mod.get('args') or []
         mod_name = config.form_module_name(raw_name)
         if not mod_name:
             continue
         if freq and freq not in FREQUENCIES:
             LOG.warn(("Config specified module %s"
                       " has an unknown frequency %s"), raw_name, freq)
             # Reset it so when ran it will get set to a known value
             freq = None
         mod_locs = importer.find_module(
             mod_name, ['', type_utils.obj_name(config)], ['handle'])
         if not mod_locs:
             LOG.warn("Could not find module named %s", mod_name)
             continue
         mod = config.fixup_module(importer.import_module(mod_locs[0]))
         mostly_mods.append([mod, raw_name, freq, run_args])
     return mostly_mods