Pure-Storage-Ansible / FlashArray-Collection

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

"create_pgsnapshot" in plugins/modules/purefa_pgsnap.py calls "protection_group_snapshots_api.py" from the py-pure-client with the wrongly named parameter "throttle" instead of "allow_throttle" #515

Closed AheroX closed 7 months ago

AheroX commented 7 months ago

"create_pgsnapshot" in plugins/modules/purefa_pgsnap.py calls "protection_group_snapshots_api.py" from the py-pure-client with the wrongly named parameter "throttle" instead of "allow_throttle" to fail if array health is not optimal.

To Reproduce

  1. install current py-pure-client as well as current ansible-collection
  2. run: $ ansible -i [...] [...] -c local -m purestorage.flasharray.purefa_pgsnap -a 'fa_url=[...] api_token=[...] name="[...]"' -vv ansible [core 2.15.6] [...] PLAYBOOK: __adhoc_playbook__ **

PLAY [Ansible Ad-Hoc] *****

TASK [purestorage.flasharray.purefa_pgsnap fa_url=[...], api_token=[...], name=[...]] ** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: post_protection_group_snapshots() got an unexpected keyword argument 'throttle' fatal: [...]: FAILED! => changed=false ansible_facts: discovered_interpreter_python: /usr/bin/python3 module_stderr: |- Traceback (most recent call last): File "[...]/AnsiballZ_purefa_pgsnap.py", line 107, in _ansiballz_main() File "[...]/AnsiballZ_purefa_pgsnap.py", line 99, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "[...]/AnsiballZ_purefa_pgsnap.py", line 47, in invoke_module runpy.run_module(mod_name='ansible_collections.purestorage.flasharray.plugins.modules.purefa_pgsnap', init_globals=dict(_module_fqn='ansible_collections.purestorage.flasharray.plugins.modules.purefa_pgsnap', _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 "[...]/flasharray/plugins/modules/purefa_pgsnap.py", line 615, in File "[...]/flasharray/plugins/modules/purefa_pgsnap.py", line 593, in main File "[...]/flasharray/plugins/modules/purefa_pgsnap.py", line 336, in create_pgsnapshot TypeError: post_protection_group_snapshots() got an unexpected keyword argument 'throttle' module_stdout: '' msg: |- MODULE FAILURE See stdout/stderr for the exact error rc: 1

PLAY RECAP **** [...] : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

Expected behavior Creating a snapshot of mentioned PG.

Desktop (please complete the following information):

Fix see https://github.com/AheroX/pureFlashArray-Collection/blob/bugfixallow_throttle/plugins/modules/purefa_pgsnap.py

sdodsley commented 7 months ago

Hi @AheroX . Thanks for finding this typo. Please feel free to submit a PR with your fix

AheroX commented 7 months ago

feel free to submit a PR with your fix

Thanks a lot for the fast review! Any chance to issue a bugfix-release? ... this issue stops my customer from upgrading to PurityOS 6.5.

sdodsley commented 7 months ago

Yes - I'll look at a release latter today when your patch has merged

sdodsley commented 7 months ago

Fixed in #516