From a3c597425df71afd907423e3ff98da0c3532f055 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 20 Oct 2021 17:49:01 +0200 Subject: [PATCH] Redfish: perform manager network interface configuration even if property is missing (#3582) (#3590) * Redfish: perform manager network interface configuration even if property is missing Signed-off-by: Mike Raineri * Update changelogs/fragments/3404-redfish_utils-skip-manager-network-check.yml Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein (cherry picked from commit 6580e7559b56f77aa1dc960e771a47594dde66de) Co-authored-by: Mike Raineri --- .../3404-redfish_utils-skip-manager-network-check.yml | 2 ++ plugins/module_utils/redfish_utils.py | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/3404-redfish_utils-skip-manager-network-check.yml diff --git a/changelogs/fragments/3404-redfish_utils-skip-manager-network-check.yml b/changelogs/fragments/3404-redfish_utils-skip-manager-network-check.yml new file mode 100644 index 0000000000..9b17761ff2 --- /dev/null +++ b/changelogs/fragments/3404-redfish_utils-skip-manager-network-check.yml @@ -0,0 +1,2 @@ +bugfixes: + - redfish_utils module utils - if a manager network property is not specified in the service, attempt to change the requested settings (https://github.com/ansible-collections/community.general/issues/3404/). diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py index b15e86a52e..aa45f9d982 100644 --- a/plugins/module_utils/redfish_utils.py +++ b/plugins/module_utils/redfish_utils.py @@ -2740,7 +2740,9 @@ class RedfishUtils(object): if isinstance(set_value, dict): for subprop in payload[property].keys(): if subprop not in target_ethernet_current_setting[property]: - return {'ret': False, 'msg': "Sub-property %s in nic_config is invalid" % subprop} + # Not configured already; need to apply the request + need_change = True + break sub_set_value = payload[property][subprop] sub_cur_value = target_ethernet_current_setting[property][subprop] if sub_set_value != sub_cur_value: @@ -2754,7 +2756,9 @@ class RedfishUtils(object): for i in range(len(set_value)): for subprop in payload[property][i].keys(): if subprop not in target_ethernet_current_setting[property][i]: - return {'ret': False, 'msg': "Sub-property %s in nic_config is invalid" % subprop} + # Not configured already; need to apply the request + need_change = True + break sub_set_value = payload[property][i][subprop] sub_cur_value = target_ethernet_current_setting[property][i][subprop] if sub_set_value != sub_cur_value: