[PR #11144/5617d57c backport][stable-12] xcc_redfish_command: fix messages showing dict keys (#11162)

xcc_redfish_command: fix messages showing dict keys (#11144)

* xcc_redfish_command: fix messages showing dict keys

* add changelog frag

* Update plugins/modules/xcc_redfish_command.py



* Update plugins/modules/xcc_redfish_command.py



* Apply suggestions from code review

* Update plugins/modules/xcc_redfish_command.py

---------


(cherry picked from commit 5617d57c8c)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot]
2025-11-15 23:17:16 +01:00
committed by GitHub
parent 6d582acb26
commit 15d4fff749
2 changed files with 4 additions and 2 deletions

View File

@@ -556,7 +556,7 @@ class XCCRedfishUtils(RedfishUtils):
data = response["data"]
for key in request_body.keys():
if key not in data:
return {"ret": False, "msg": f"Key {key} not found. Supported key list: {data.keys()}"}
return {"ret": False, "msg": f"Key {key} not found. Supported key list: {list(data)}"}
# perform patch
response = self.patch_request(self.root_uri + resource_uri, request_body)
@@ -735,7 +735,7 @@ def main():
# Check that Category is valid
if category not in CATEGORY_COMMANDS_ALL:
module.fail_json(msg=f"Invalid Category '{category}'. Valid Categories = {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: