mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
modules [no]*: use f-strings (#10973)
* modules [no]*: use f-strings * add changelog frag
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user