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

Fix for issue #56137 - problem with Chassis/Power URI #56185

Open
wants to merge 2 commits into
base: devel
from

Conversation

Projects
None yet
6 participants
@mgarrett33
Copy link

commented May 7, 2019

SUMMARY

Assemble the Power URI from @odata.id information in the Chassis resource

Fixes #56137

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

redfish_facts

ADDITIONAL INFORMATION

Test against HPE ProLiant servers with iLO 5

BEFORE CHANGE

The following output:

TASK [Get Chassis Power] ********************************************************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'data'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1557169030.74096-151454169883598/AnsiballZ_redfish_facts.py\", line 125, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1557169030.74096-151454169883598/AnsiballZ_redfish_facts.py\", line 117, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1557169030.74096-151454169883598/AnsiballZ_redfish_facts.py\", line 51, in invoke_module\n    spec.loader.exec_module(module)\n  File \"<frozen importlib._bootstrap_external>\", line 678, in exec_module\n  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n  File \"/tmp/ansible_redfish_facts_payload_vijwehp0/__main__.py\", line 346, in <module>\n  File \"/tmp/ansible_redfish_facts_payload_vijwehp0/__main__.py\", line 303, in main\n  File \"/tmp/ansible_redfish_facts_payload_vijwehp0/ansible_redfish_facts_payload.zip/ansible/module_utils/redfish_utils.py\", line 1048, in get_chassis_power\nKeyError: 'data'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

AFTER CHANGE

Output like this:

TASK [Get Chassis Power] ********************************************************************************************************************************************************************************************************************
ok: [localhost] => {"ansible_facts": {"redfish_facts": {"chassis_power": {"entries": [{"PowerCapacityWatts": 500, "PowerConsumedWatts": 0, "PowerMetrics": {"AverageConsumedWatts": 0, "IntervalInMin": 20, "MaxConsumedWatts": 0, "MinConsumedWatts": 0}}], "ret": true}}}, "changed": false}
Fix for issue #56137 - problem with Chassis/Power URI and GetChassisP…
…ower command - assemble URI from data in Chassis resource
@ansibot

This comment has been minimized.

@billdodd
Copy link
Contributor

left a comment

Thanks, @mgarrett33 for the contribution! I reviewed and tested. Looks good.

shipit

@ansibot ansibot removed the needs_triage label May 7, 2019

@mgarrett33

This comment has been minimized.

Copy link
Author

commented May 14, 2019

Thank you @billdodd. For submission etiquette: Am I finished here or is there something else I need to do after your shipit comment?

@billdodd

This comment has been minimized.

Copy link
Contributor

commented May 14, 2019

Thank you @billdodd. For submission etiquette: Am I finished here or is there something else I need to do after your shipit comment?

@mgarrett33 - You don't need to do anything else. The PR does need one more community maintainer to review and approve. I expect that will happen shortly. (@jose-delarosa @mraineri)

@jose-delarosa

This comment has been minimized.

Copy link
Contributor

commented May 14, 2019

Tested it, doesn't appear to impact Dell systems, same message as before:

{
    "ansible_facts": {
        "redfish_facts": {
            "chassis_power": {
                "msg": "Key Power not found.",
                "ret": false
            }
        }
    },
    "changed": false,
    "failed": false
}

shipit

@ansibot ansibot added shipit and removed community_review labels May 14, 2019

@samerhaj

This comment has been minimized.

Copy link

commented May 16, 2019

verified on Lenovo system, and works as intended

shipt

@mraineri

This comment has been minimized.

Copy link

commented May 20, 2019

shipit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.