mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-06-11 18:45:34 +00:00
[PR #12124/b799c6f5 backport][stable-12] redfish_config: fix KeyError: 'ret' when SetManagerNic cannot find a matching NIC (#12173)
redfish_config: fix `KeyError: 'ret'` when `SetManagerNic` cannot find a matching NIC (#12124)
* fix(redfish_config): return proper error dict when manager NIC not found
get_manager_ethernet_uri() returned an empty dict {} when no matching NIC
was found, causing a KeyError on 'ret' in main(). Now returns a consistent
{"ret": False, "msg": ...} like all other error paths in the function.
Fixes #5892
* feat(changelog): add fragment for PR 12124
(cherry picked from commit b799c6f579)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
6da3c81889
commit
eed2e1d2ac
2 changed files with 5 additions and 1 deletions
|
|
@ -3685,7 +3685,7 @@ class RedfishUtils:
|
|||
nic_info["ethernet_setting"] = target_ethernet_current_setting
|
||||
|
||||
if target_ethernet_uri is None:
|
||||
return {}
|
||||
return {"ret": False, "msg": f"Manager NIC with address '{nic_addr}' not found"}
|
||||
else:
|
||||
return nic_info
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue