mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-26 21:33:12 +00:00
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 Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/xcc_redfish_command.py Co-authored-by: Felix Fontein <felix@fontein.de> * Apply suggestions from code review * Update plugins/modules/xcc_redfish_command.py --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user