straight up: ruff format (#11329)

* straight up: ruff format

* Apply suggestions from code review
This commit is contained in:
Alexei Znamensky
2025-12-28 01:36:24 +13:00
committed by GitHub
parent 04d0a4daf3
commit d549baa5e1
36 changed files with 438 additions and 396 deletions

View File

@@ -37,17 +37,19 @@ def main():
info = None
arg_formats = {}
for arg, fmt_spec in p['arg_formats'].items():
func = getattr(fmt, fmt_spec['func'])
for arg, fmt_spec in p["arg_formats"].items():
func = getattr(fmt, fmt_spec["func"])
args = fmt_spec.get("args", [])
arg_formats[arg] = func(*args)
try:
runner = CmdRunner(module, [module.params["cmd"], '--'], arg_formats=arg_formats, path_prefix=module.params["path_prefix"])
runner = CmdRunner(
module, [module.params["cmd"], "--"], arg_formats=arg_formats, path_prefix=module.params["path_prefix"]
)
with runner.context(p['arg_order'], check_mode_skip=p['check_mode_skip']) as ctx:
result = ctx.run(**p['arg_values'])
with runner.context(p["arg_order"], check_mode_skip=p["check_mode_skip"]) as ctx:
result = ctx.run(**p["arg_values"])
info = ctx.run_info
check = "check"
rc, out, err = result if result is not None else (None, None, None)
@@ -57,5 +59,5 @@ def main():
module.fail_json(rc=1, module_stderr=traceback.format_exc(), msg="Module crashed with exception")
if __name__ == '__main__':
if __name__ == "__main__":
main()