From ca8ecb1df1544ba702a422b32f927778a80bd6b9 Mon Sep 17 00:00:00 2001 From: Mike Koreneff Date: Fri, 12 Jul 2024 22:08:43 +0100 Subject: [PATCH] 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 --- 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