From 93e0aa7557232ebb1636153b22e1a1091754e8c1 Mon Sep 17 00:00:00 2001 From: lukurde <47138492+lukurde@users.noreply.github.com> Date: Wed, 10 Feb 2021 19:47:09 +0100 Subject: [PATCH] redfish module_utils: case insesitive search for situations where the hostname/FQDN on iLO is in caps (#1744) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * case insesitive search for situations where the hostname/FQDN on iLO is in caps * handle explicit and implicit nic_addr variable, added changelog fragment * changelog linter fix * changelog typo fix Co-authored-by: Ɓukasz Kurdziel --- .../fragments/1744-case-insensitive-hostname-fqdn-matching.yml | 2 ++ plugins/module_utils/redfish_utils.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/1744-case-insensitive-hostname-fqdn-matching.yml diff --git a/changelogs/fragments/1744-case-insensitive-hostname-fqdn-matching.yml b/changelogs/fragments/1744-case-insensitive-hostname-fqdn-matching.yml new file mode 100644 index 0000000000..0e9c086b96 --- /dev/null +++ b/changelogs/fragments/1744-case-insensitive-hostname-fqdn-matching.yml @@ -0,0 +1,2 @@ +minor_changes: + - redfish_config - case insensitive search for situations where the hostname/FQDN case on iLO doesn't match variable's case (https://github.com/ansible-collections/community.general/pull/1744). diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py index 8f14dbad78..01b1f9a29f 100644 --- a/plugins/module_utils/redfish_utils.py +++ b/plugins/module_utils/redfish_utils.py @@ -2632,7 +2632,7 @@ class RedfishUtils(object): if response['ret'] is False: return response data = response['data'] - if '"' + nic_addr + '"' in str(data) or "'" + nic_addr + "'" in str(data): + if '"' + nic_addr.lower() + '"' in str(data).lower() or "'" + nic_addr.lower() + "'" in str(data).lower(): target_ethernet_uri = uri target_ethernet_current_setting = data break