Pure-Storage-Ansible / FlashArray-Collection

Ansible Collection for Pure Storage FlashArray
GNU General Public License v3.0
18 stars 22 forks source link

Module error within purefa_logging module of Ansible Pure collection version 1.19.1 #407

Closed colinet closed 1 year ago

colinet commented 1 year ago

Describe the bug Module error within purefa_logging of Ansible Pure collection version 1.19.1

To Reproduce Steps to reproduce the behavior:

1/ Install Ansible Pure collection for flasharray

# ansible-galaxy collection install -U purestorage.flasharray  
# ansible-galaxy collection list |grep pure  
purestorage.flasharray 1.19.1
purestorage.flasharray 1.11.0
purestorage.flashblade 1.8.1

2/ Run below playbook:

- name: pure | helpers dump | get audit list   
  purestorage.flasharray.purefa_logging:   
    fa_url: "{{ san_CRUD_fa_url }}"   
    api_token: "{{ san_CRUD_api_token }}"   
  register: audit_output

Playbook triggers below stack trace:

warnings.warn(
Traceback (most recent call last):
File \"/home/rcolinet/.ansible/tmp/ansible-tmp-1684839370.8140526-450947-149218790738004/AnsiballZ_purefa_logging.py\", line 100, in <module>\n    _ansiballz_main()
File \"/home/rcolinet/.ansible/tmp/ansible-tmp-1684839370.8140526-450947-149218790738004/AnsiballZ_purefa_logging.py\", line 92, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/rcolinet/.ansible/tmp/ansible-tmp-1684839370.8140526-450947-149218790738004/AnsiballZ_purefa_logging.py\", line 40, in invoke_module
    runpy.run_module(mod_name='ansible_collections.purestorage.flasharray.plugins.modules.purefa_logging', init_globals=dict(_module_fqn='ansible_collections.purestorage.flasharray.plugins.modules.purefa_logging', _modlib_path=modlib_path),
   File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module return _run_module_code(code, init_globals, run_name, mod_spec)
   File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code  _run_code(code, mod_globals, init_globals,  
   File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code exec(code, run_globals)
   File \"/tmp/ansible_purestorage.flasharray.purefa_logging_payload_hf0oni6b/ansible_purestorage.flasharray.purefa_logging_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_logging.py\", line 166, in <module>
   File \"/tmp/ansible_purestorage.flasharray.purefa_logging_payload_hf0oni6b/ansible_purestorage.flasharray.purefa_logging_payload.zip/ansible_collections/purestorage/flasharray/plugins/modules/purefa_logging.py\", line 154, in main
   File \"/usr/local/lib/python3.9/site-packages/pypureclient/flasharray/FA_2_17/models/fixed_reference.py\", line 68, in __getattribute__\n    raise AttributeError\nAttributeError\n"

Expected behavior The equivalent of CLI output for pureaudit list was expected

Additional context Context is:

sdodsley commented 1 year ago

see #408

colinet commented 1 year ago

The 1.19.1 collection was installed in my home directory on top of the standard ansible installation.

It is used as per the stack trace: /home/rcolinet/.ansible/collections/ansible_collections/purestorage/flasharray/plugins/modules/purefa_logging.py

It then calls /usr/local/lib/python3.9/site-packages/pypureclient/flasharray/FA_2_17/models/fixed_reference.py which is located in the standard ansible collections location.

colinet commented 1 year ago

I tested the commited change by modifying the code directly on my host. It works. :-)