MCPcopy Create free account
hub / github.com/canonical/cloud-init / run_module_section

Function run_module_section

cloudinit/cmd/main.py:174–190  ·  view source on GitHub ↗
(mods: Modules, action_name, section)

Source from the content-addressed store, hash-verified

172
173
174def run_module_section(mods: Modules, action_name, section):
175 full_section_name = MOD_SECTION_TPL % (section)
176 (which_ran, failures) = mods.run_section(full_section_name)
177 total_attempted = len(which_ran) + len(failures)
178 if total_attempted == 0:
179 msg = "No '%s' modules to run under section '%s'" % (
180 action_name,
181 full_section_name,
182 )
183 sys.stderr.write("%s\n" % (msg))
184 LOG.debug(msg)
185 return []
186 else:
187 LOG.debug(
188 "Ran %s modules with %s failures", len(which_ran), len(failures)
189 )
190 return failures
191
192
193def apply_reporting_cfg(cfg):

Callers 2

main_initFunction · 0.85
main_modulesFunction · 0.85

Calls 2

run_sectionMethod · 0.80
writeMethod · 0.80

Tested by

no test coverage detected