1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-16 17:01:30 +00:00

[PR #11110/996d9a7f backport][stable-12] replace batch 6 of redundant to_native()/to_text() occurrences (#11141)

replace batch 6 of redundant to_native()/to_text() occurrences (#11110)

* replace batch 6 of redundant to_native()/to_text() occurrences

* add changelog frag

(cherry picked from commit 996d9a7f63)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2025-11-12 21:59:18 +01:00 committed by GitHub
parent 619ea5b7b3
commit f1d9a2b134
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 30 additions and 52 deletions

View file

@ -140,17 +140,13 @@ def main():
# Check that Category is valid
if category not in CATEGORY_COMMANDS_ALL:
module.fail_json(
msg=to_native(f"Invalid Category '{category}'. Valid Categories = {list(CATEGORY_COMMANDS_ALL.keys())}")
)
module.fail_json(msg=f"Invalid Category '{category}'. Valid Categories = {list(CATEGORY_COMMANDS_ALL.keys())}")
# Check that all commands are valid
for cmd in command_list:
# Fail if even one command given is invalid
if cmd not in CATEGORY_COMMANDS_ALL[category]:
module.fail_json(
msg=to_native(f"Invalid Command '{cmd}'. Valid Commands = {CATEGORY_COMMANDS_ALL[category]}")
)
module.fail_json(msg=f"Invalid Command '{cmd}'. Valid Commands = {CATEGORY_COMMANDS_ALL[category]}")
if category == "Systems":
# execute only if we find a System resource