dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
339 stars 163 forks source link

module' object has no attribute 'noValue' #23

Closed DanielFroehlich closed 5 years ago

DanielFroehlich commented 5 years ago

Hi! I am trying to use IDRAC Ansible Modules, but a simple dellemc_get_firmware_inventory from the samples directory fails with above error. I am using Python 2.7.5 with ansible 2.4.2.0 an RHEL 7.6

$ ansible-playbook -vvv -i inventory.yml get_firmware_storm5.yml ansible-playbook 2.4.2.0 config file = /etc/ansible/ansible.cfg configured module search path = [u'/home/dfroehli/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible-playbook python version = 2.7.5 (default, Sep 12 2018, 05:31:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] Using /etc/ansible/ansible.cfg as config file Parsed /home/dfroehli/git/Dell-EMC-Ansible-Modules-for-iDRAC/inventory.yml inventory source with yaml plugin

PLAYBOOK: get_firmware_storm5.yml **** 1 plays in get_firmware_storm5.yml

PLAY [Get Installed Firmware Inventory] ** META: ran handlers

TASK [Get Installed Firmware Inventory] ** task path: /home/dfroehli/git/Dell-EMC-Ansible-Modules-for-iDRAC/get_firmware_storm5.yml:8 Using module file /home/dfroehli/git/Dell-EMC-Ansible-Modules-for-iDRAC/library/dellemc_get_firmware_inventory.py <10.32.104.71> ESTABLISH LOCAL CONNECTION FOR USER: dfroehli <10.32.104.71> EXEC /bin/sh -c 'echo ~ && sleep 0' <10.32.104.71> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/dfroehli/.ansible/tmp/ansible-tmp-1544098663.02-109993120111698" && echo ansible-tmp-1544098663.02-109993120111698="echo /home/dfroehli/.ansible/tmp/ansible-tmp-1544098663.02-109993120111698" ) && sleep 0' <10.32.104.71> PUT /tmp/tmpFGkknE TO /home/dfroehli/.ansible/tmp/ansible-tmp-1544098663.02-109993120111698/dellemc_get_firmware_inventory.py <10.32.104.71> EXEC /bin/sh -c 'chmod u+x /home/dfroehli/.ansible/tmp/ansible-tmp-1544098663.02-109993120111698/ /home/dfroehli/.ansible/tmp/ansible-tmp-1544098663.02-109993120111698/dellemc_get_firmware_inventory.py && sleep 0' <10.32.104.71> EXEC /bin/sh -c '/usr/bin/python /home/dfroehli/.ansible/tmp/ansible-tmp-1544098663.02-109993120111698/dellemc_get_firmware_inventory.py; rm -rf "/home/dfroehli/.ansible/tmp/ansible-tmp-1544098663.02-109993120111698/" > /dev/null 2>&1 && sleep 0' The full traceback is: Traceback (most recent call last): File "/tmp/ansible_gEqX4a/ansible_module_dellemc_get_firmware_inventory.py", line 68, in from ansible.module_utils.dellemc_idrac import iDRACConnection File "/tmp/ansible_gEqX4a/ansible_modlib.zip/ansible/module_utils/dellemc_idrac.py", line 21, in File "/usr/lib/python2.7/site-packages/omsdk-1.2.345-py2.7.egg/omsdk/sdkcreds.py", line 27, in from omsdk.sdkprint import PrettyPrint File "/usr/lib/python2.7/site-packages/omsdk-1.2.345-py2.7.egg/omsdk/sdkprint.py", line 44, in from pysnmp.hlapi import File "/usr/lib/python2.7/site-packages/pysnmp/hlapi/init.py", line 7, in from pysnmp.proto.rfc1902 import File "/usr/lib/python2.7/site-packages/pysnmp/proto/rfc1902.py", line 9, in from pysnmp.proto import rfc1155, error File "/usr/lib/python2.7/site-packages/pysnmp/proto/rfc1155.py", line 50, in class NetworkAddress(univ.Choice): File "/usr/lib/python2.7/site-packages/pysnmp/proto/rfc1155.py", line 55, in NetworkAddress def clone(self, value=univ.noValue, **kwargs): AttributeError: 'module' object has no attribute 'noValue'

fatal: [10.32.104.71]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_gEqX4a/ansible_module_dellemc_get_firmware_inventory.py\", line 68, in \n from ansible.module_utils.dellemc_idrac import iDRACConnection\n File \"/tmp/ansible_gEqX4a/ansible_modlib.zip/ansible/module_utils/dellemc_idrac.py\", line 21, in \n File \"/usr/lib/python2.7/site-packages/omsdk-1.2.345-py2.7.egg/omsdk/sdkcreds.py\", line 27, in \n from omsdk.sdkprint import PrettyPrint\n File \"/usr/lib/python2.7/site-packages/omsdk-1.2.345-py2.7.egg/omsdk/sdkprint.py\", line 44, in \n from pysnmp.hlapi import \n File \"/usr/lib/python2.7/site-packages/pysnmp/hlapi/init.py\", line 7, in \n from pysnmp.proto.rfc1902 import \n File \"/usr/lib/python2.7/site-packages/pysnmp/proto/rfc1902.py\", line 9, in \n from pysnmp.proto import rfc1155, error\n File \"/usr/lib/python2.7/site-packages/pysnmp/proto/rfc1155.py\", line 50, in \n class NetworkAddress(univ.Choice):\n File \"/usr/lib/python2.7/site-packages/pysnmp/proto/rfc1155.py\", line 55, in NetworkAddress\n def clone(self, value=univ.noValue, **kwargs):\nAttributeError: 'module' object has no attribute 'noValue'\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0 }

Any idea? Thx Dan

DanielFroehlich commented 5 years ago

This is version mismatch with pyasn, as described here: [https://github.com/etingof/pysnmp/issues/69]

Can be fixed with: pip install pyasn1 --upgrade I will file a pull request against omsdk requirements-python2x.txt, I think that would be the right place to fix.