From 92dcf1e0b238d3bb7ebb089eec84472e364d7771 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 23:23:50 +0200 Subject: [PATCH] [PR #8613/ca8ecb1d backport][stable-9] redfish_utils: fix language check (#8617) redfish_utils: fix language check (#8613) * redfish_utils: fix language check * add fragment file * typo * improve words * improve words based on suggestion --------- Co-authored-by: Mike Koreneff (cherry picked from commit ca8ecb1df1544ba702a422b32f927778a80bd6b9) Co-authored-by: Mike Koreneff --- changelogs/fragments/8613-redfish_utils-language.yaml | 2 ++ plugins/module_utils/redfish_utils.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/8613-redfish_utils-language.yaml diff --git a/changelogs/fragments/8613-redfish_utils-language.yaml b/changelogs/fragments/8613-redfish_utils-language.yaml new file mode 100644 index 0000000000..1fc43c895d --- /dev/null +++ b/changelogs/fragments/8613-redfish_utils-language.yaml @@ -0,0 +1,2 @@ +bugfixes: + - redfish_utils module utils - do not fail when language is not exactly "en" (https://github.com/ansible-collections/community.general/pull/8613). diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py index 4240b9e4e7..edfc612466 100644 --- a/plugins/module_utils/redfish_utils.py +++ b/plugins/module_utils/redfish_utils.py @@ -3833,7 +3833,7 @@ class RedfishUtils(object): vendor = self._get_vendor()['Vendor'] rsp_uri = "" for loc in resp_data['Location']: - if loc['Language'] == "en": + if loc['Language'].startswith("en"): rsp_uri = loc['Uri'] if vendor == 'HPE': # WORKAROUND