Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #8613/ca8ecb1d backport][stable-8] redfish_utils: fix language check #8616

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Jul 12, 2024

This is a backport of PR #8613 as merged into main (ca8ecb1).

SUMMARY

Fixes bug when Language is not exactly en

community.general.redfish_info:
  category: Systems
  command: GetBiosRegistries

incorrectly returns

        if not rsp_uri:
            msg = "Language 'en' not found in BIOS Attribute Registries location, URI: %s, response: %s"

example:

            "bios_registries": {
                "msg": "Language 'en' not found in BIOS Attribute Registries location, <snip>
                "ret": false
            }
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

plugins/module_utils/redfish_utils.py

ADDITIONAL INFORMATION

Reproduce the issue:

bios_registry.yaml:

  tasks:    
  - delegate_to: localhost    
    block:    
      - name: Get Bios Registries    
        community.general.redfish_info:    
          <<: *redfish    
          category: Systems    
          command: GetBiosRegistries    
        register: bios_data    
    
      - ansible.builtin.debug: var=bios_data    

ansible-playbook --inventory "host," bios_registry.yaml

TASK [Get Bios Registries] ********************************************************************************************
[DEPRECATION WARNING]: The default value 10 for parameter param1 is being deprecated and it will be replaced by 60. 
This feature will be removed from community.general in version 9.0.0. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.
ok: [host -> localhost]

TASK [ansible.builtin.debug] ******************************************************************************************
ok: [host -> localhost] => {
    "bios_data": {
        "changed": false,
        "deprecations": [
            {
                "collection_name": "community.general",
                "msg": "The default value 10 for parameter param1 is being deprecated and it will be replaced by 60",
                "version": "9.0.0"
            }
        ],
        "failed": false,
        "redfish_facts": {
            "bios_registries": {
                "msg": "Language 'en' not found in BIOS Attribute Registries location, URI: https://host-ipmi/redfish/v1/Registries/BiosAttributeRegistryA3167.1.17.1, response: {'@odata.context': '/redfish/v1/$metadata#MessageRegistryFile.MessageRegistryFile', '@odata.etag': '\"1720539421\"', '@odata.id': '/redfish/v1/Registries/BiosAttributeRegistryA3167.1.17.1', '@odata.type': '#MessageRegistryFile.v1_1_3.MessageRegistryFile', 'Description': 'Registry for BiosAttributeRegistryA3167.1.17.1', 'Id': 'BiosAttributeRegistryA3167.1.17.1', 'Languages': ['en-US'], 'Location': [{'Language': 'en-US', 'Uri': '/redfish/v1/Registries/BiosAttributeRegistryA3167.en-US.1.17.1.json'}], 'Name': 'BiosAttributeRegistryA3167.1.17.1 Registry', 'Registry': 'BiosAttributeRegistryA3167.1.17.1'}",
                "ret": false
            }
        }
    }
}

with the fix in place
ansible-playbook --inventory "host," bios_registry.yaml

TASK [Get Bios Registries] **********************************************************************************************
[DEPRECATION WARNING]: The default value 10 for parameter param1 is being deprecated and it will be replaced by 60. This
 feature will be removed from community.general in version 9.0.0. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.
ok: [host -> localhost]

TASK [ansible.builtin.debug] ********************************************************************************************
ok: [host -> localhost] => {
    "bios_data": {
        "changed": false,
        "deprecations": [
            {
                "collection_name": "community.general",
                "msg": "The default value 10 for parameter param1 is being deprecated and it will be replaced by 60",
                "version": "9.0.0"
            }
        ],
        "failed": false,
        "redfish_facts": {
            "bios_registries": {
                "bios_registry": {
                    "@odata.context": "/redfish/v1/$metadata#AttributeRegistry.AttributeRegistry",
                    "@odata.etag": "Dummyetag",
                    "@odata.id": "/redfish/v1/Registries/BiosAttributeRegistryA3167.en-US.1.17.1.json",
                    "@odata.type": "#AttributeRegistry.v1_3_1.AttributeRegistry",
                    "Description": "This registry defines a representation of BIOS Attribute instances",
                    "Id": "BiosAttributeRegistryA3167.en-US.1.17.1",
                    "Language": "en-US",
                    "Name": "A3167 BIOS Attribute Registry",
                    "OwningEntity": "AMI",
                    "RegistryEntries": {
                        "Attributes": [

* redfish_utils: fix language check

* add fragment file

* typo

* improve words

* improve words based on suggestion

---------

Co-authored-by: Mike Koreneff <[email protected]>
(cherry picked from commit ca8ecb1)
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug module_utils module_utils needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type) labels Jul 12, 2024
@felixfontein felixfontein merged commit 37a9f18 into stable-8 Jul 12, 2024
146 checks passed
@felixfontein felixfontein deleted the patchback/backports/stable-8/ca8ecb1df1544ba702a422b32f927778a80bd6b9/pr-8613 branch July 12, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport bug This issue/PR relates to a bug module_utils module_utils needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants