From 37a9f18fabb65a31edd63f08bcedd4ee68158e83 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 23:23:47 +0200 Subject: [PATCH] [PR #8613/ca8ecb1d backport][stable-8] redfish_utils: fix language check (#8616) 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 6935573d0b..ca04c17335 100644 --- a/plugins/module_utils/redfish_utils.py +++ b/plugins/module_utils/redfish_utils.py @@ -3786,7 +3786,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