mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-21 03:09:04 +00:00
modules [no]*: use f-strings (#10973)
* modules [no]*: use f-strings * add changelog frag
This commit is contained in:
parent
50846b7560
commit
749c06cd01
44 changed files with 399 additions and 412 deletions
|
|
@ -403,7 +403,7 @@ def handle_enabled(module, result, service_path):
|
|||
if not module.check_mode:
|
||||
(rc, out, err) = run_sys_ctl(module, [action, service_path])
|
||||
if rc != 0:
|
||||
module.fail_json(msg="Unable to %s service %s: %s" % (action, service_path, out + err))
|
||||
module.fail_json(msg=f"Unable to {action} service {service_path}: {out + err}")
|
||||
result['preset'] = not preset
|
||||
result['enabled'] = not enabled
|
||||
|
||||
|
|
@ -420,7 +420,7 @@ def handle_enabled(module, result, service_path):
|
|||
if not module.check_mode:
|
||||
(rc, out, err) = run_sys_ctl(module, [action, service_path])
|
||||
if rc != 0:
|
||||
module.fail_json(msg="Unable to %s service %s: %s" % (action, service_path, out + err))
|
||||
module.fail_json(msg=f"Unable to {action} service {service_path}: {out + err}")
|
||||
result['enabled'] = not enabled
|
||||
result['preset'] = not preset
|
||||
|
||||
|
|
@ -496,7 +496,7 @@ def handle_state(module, result, service_path):
|
|||
if not module.check_mode:
|
||||
(rc, out, err) = run_sys_ctl(module, [action, service_path])
|
||||
if rc != 0:
|
||||
module.fail_json(msg="Unable to %s service %s: %s" % (action, service_path, err))
|
||||
module.fail_json(msg=f"Unable to {action} service {service_path}: {err}")
|
||||
|
||||
# ===========================================
|
||||
# Main control flow
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue