dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
340 stars 164 forks source link

[BUG]: Fatal error - dellemc.openmanage.redfish_powerstate: #513

Closed markatdxb closed 1 year ago

markatdxb commented 1 year ago

Bug Description

i'm getting fatal error when using this module. It used to work fine before upgrad to that later versions of Ansible and Dell collections.

Component or Module Name

dellemc.openmanage.redfish_powerstate:

Ansible Version

Ansible 8.0.0

Python Version

Python 3.9.6

iDRAC/OME/OME-M version

iDRAC 9 Version 6.10.80.00(Build 35)

Operating System

CentOS Linux release 8.2.2004

Playbook Used

- name: test playbook
  hosts: localhost
  gather_facts: false

- name: "Power on the server via iDRAC"
      dellemc.openmanage.redfish_powerstate:
        baseuri: "{{ lom_ip }}"
        username: "{{ lom_username }}"
        password: "{{ lom_password }}"
        validate_certs: false
        reset_type: "On"

Logs

{ "module_stdout": "", "module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1690414478.3706777-61975-110082479999612/AnsiballZ_redfish_powerstate.py\", line 107, in \n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-tmp-1690414478.3706777-61975-110082479999612/AnsiballZ_redfish_powerstate.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-tmp-1690414478.3706777-61975-110082479999612/AnsiballZ_redfish_powerstate.py\", line 48, in invoke_module\n run_name='main', alter_sys=True)\n File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n mod_name, mod_spec, pkg_name, script_name)\n File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_dellemc.openmanage.redfish_powerstate_payloadpu2yruw/ansible_dellemc.openmanage.redfish_powerstate_payload.zip/ansible_collections/dellemc/openmanage/plugins/modules/redfish_powerstate.py\", line 121, in \n File \"\", line 971, in _find_and_load\n File \"\", line 955, in _find_and_load_unlocked\n File \"\", line 656, in _load_unlocked\n File \"\", line 626, in _load_backward_compatible\n File \"/tmp/ansible_dellemc.openmanage.redfish_powerstate_payloadpu2yruw/ansible_dellemc.openmanage.redfish_powerstate_payload.zip/ansible_collections/dellemc/openmanage/plugins/module_utils/redfish.py\", line 34, in \n File \"\", line 971, in _find_and_load\n File \"\", line 955, in _find_and_load_unlocked\n File \"\", line 656, in _load_unlocked\n File \"\", line 626, in _load_backward_compatible\n File \"/tmp/ansible_dellemc.openmanage.redfish_powerstate_payloadpu2yruw/ansible_dellemc.openmanage.redfish_powerstate_payload.zip/ansible/module_utils/urls.py\", line 190, in \n File \"/var/lib/awx/venv/alv_py39/lib/python3.9/site-packages/cryptography/init.py\", line 5\n from future import annotations\n ^\nSyntaxError: future feature annotations is not defined\n", "exception": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1690414478.3706777-61975-110082479999612/AnsiballZ_redfish_powerstate.py\", line 107, in \n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-tmp-1690414478.3706777-61975-110082479999612/AnsiballZ_redfish_powerstate.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-tmp-1690414478.3706777-61975-110082479999612/AnsiballZ_redfish_powerstate.py\", line 48, in invoke_module\n run_name='main', alter_sys=True)\n File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n mod_name, mod_spec, pkg_name, script_name)\n File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_dellemc.openmanage.redfish_powerstate_payloadpu2yruw/ansible_dellemc.openmanage.redfish_powerstate_payload.zip/ansible_collections/dellemc/openmanage/plugins/modules/redfish_powerstate.py\", line 121, in \n File \"\", line 971, in _find_and_load\n File \"\", line 955, in _find_and_load_unlocked\n File \"\", line 656, in _load_unlocked\n File \"\", line 626, in _load_backward_compatible\n File \"/tmp/ansible_dellemc.openmanage.redfish_powerstate_payloadpu2yruw/ansible_dellemc.openmanage.redfish_powerstate_payload.zip/ansible_collections/dellemc/openmanage/plugins/module_utils/redfish.py\", line 34, in \n File \"\", line 971, in _find_and_load\n File \"\", line 955, in _find_and_load_unlocked\n File \"\", line 656, in _load_unlocked\n File \"\", line 626, in _load_backward_compatible\n File \"/tmp/ansible_dellemc.openmanage.redfish_powerstate_payloadpu2yruw/ansible_dellemc.openmanage.redfish_powerstate_payload.zip/ansible/module_utils/urls.py\", line 190, in \n File \"/var/lib/awx/venv/alv_py39/lib/python3.9/site-packages/cryptography/init.py\", line 5\n from future import annotations\n ^\nSyntaxError: future feature annotations is not defined\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1, "_ansible_no_log": null, "attempts": 1, "changed": false, "retries": 7 }

Steps to Reproduce

run the playbook - there is no special configuration

Expected Behavior

power on the server

Actual Behavior

fatal error

Screenshots

No response

Additional Information

No response

markatdxb commented 1 year ago

After running some tests i might have found a solution. Problem disappeared after downgrading the cryptography from 41.0.2 to 40.0.2. I have also upgraded Openmanage collection from 7.5.0 to 8.0.0

sachin-apa commented 1 year ago

@markatdxb I'm closing this issue, please reopen is necessary.