mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-24 04:39:15 +00:00
Replace % string formatting with f-strings across multiple plugins (#11908)
* Replace % string formatting with f-strings across multiple plugins Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * Add changelog fragment for PR 11908 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
253ac45dd3
commit
53397c081a
14 changed files with 65 additions and 64 deletions
|
|
@ -126,7 +126,6 @@ except ImportError:
|
|||
|
||||
UUID_REQUIRED = "UUID of device is required for nodes_by_uuid command."
|
||||
CHASSIS_UUID_REQUIRED = "UUID of chassis is required for nodes_by_chassis_uuid command."
|
||||
SUCCESS_MSG = "Success %s result"
|
||||
|
||||
|
||||
def _nodes(module, lxca_con):
|
||||
|
|
@ -192,7 +191,7 @@ def execute_module(module):
|
|||
try:
|
||||
with connection_object(module) as lxca_con:
|
||||
result = FUNC_DICT[module.params["command_options"]](module, lxca_con)
|
||||
module.exit_json(changed=False, msg=SUCCESS_MSG % module.params["command_options"], result=result)
|
||||
module.exit_json(changed=False, msg=f"Success {module.params['command_options']} result", result=result)
|
||||
except Exception as exception:
|
||||
error_msg = "; ".join(exception.args)
|
||||
module.fail_json(msg=error_msg, exception=traceback.format_exc())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue