-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 vmadm get_vm_uuid out of range #5628
Conversation
```bash An exception occurred during task execution. To see the full traceback, use -vvv. The error was: IndexError: Replacement index 1 out of range for positional args tuple fatal: [192.168.1.111]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 192.168.1.111 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/root/.ansible/tmp/ansible-tmp-1669747224.152739-62818-126536782663630/AnsiballZ_vmadm.py\", line 107, in <module>\r\n _ansiballz_main()\r\n File \"/root/.ansible/tmp/ansible-tmp-1669747224.152739-62818-126536782663630/AnsiballZ_vmadm.py\", line 99, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/root/.ansible/tmp/ansible-tmp-1669747224.152739-62818-126536782663630/AnsiballZ_vmadm.py\", line 47, in invoke_module\r\n runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.vmadm', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.vmadm', _modlib_path=modlib_path),\r\n File \"/opt/tools/lib/python3.10/runpy.py\", line 224, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/opt/tools/lib/python3.10/runpy.py\", line 96, in _run_module_code\r\n _run_code(code, mod_globals, init_globals,\r\n File \"/opt/tools/lib/python3.10/runpy.py\", line 86, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_community.general.vmadm_payload_jpca_c47/ansible_community.general.vmadm_payload.zip/ansible_collections/community/general/plugins/modules/vmadm.py\", line 785, in <module>\r\n File \"/tmp/ansible_community.general.vmadm_payload_jpca_c47/ansible_community.general.vmadm_payload.zip/ansible_collections/community/general/plugins/modules/vmadm.py\", line 730, in main\r\n File \"/tmp/ansible_community.general.vmadm_payload_jpca_c47/ansible_community.general.vmadm_payload.zip/ansible_collections/community/general/plugins/modules/vmadm.py\", line 441, in get_vm_uuid\r\nIndexError: Replacement index 1 out of range for positional args tuple\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Could you please add a changelog fragment? Thanks!
```bash An exception occurred during task execution. To see the full traceback, use -vvv. The error was: IndexError: Replacement index 1 out of range for positional args tuple fatal: [192.168.1.111]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 192.168.1.111 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/root/.ansible/tmp/ansible-tmp-1669747224.152739-62818-126536782663630/AnsiballZ_vmadm.py\", line 107, in <module>\r\n _ansiballz_main()\r\n File \"/root/.ansible/tmp/ansible-tmp-1669747224.152739-62818-126536782663630/AnsiballZ_vmadm.py\", line 99, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/root/.ansible/tmp/ansible-tmp-1669747224.152739-62818-126536782663630/AnsiballZ_vmadm.py\", line 47, in invoke_module\r\n runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.vmadm', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.vmadm', _modlib_path=modlib_path),\r\n File \"/opt/tools/lib/python3.10/runpy.py\", line 224, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/opt/tools/lib/python3.10/runpy.py\", line 96, in _run_module_code\r\n _run_code(code, mod_globals, init_globals,\r\n File \"/opt/tools/lib/python3.10/runpy.py\", line 86, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_community.general.vmadm_payload_jpca_c47/ansible_community.general.vmadm_payload.zip/ansible_collections/community/general/plugins/modules/vmadm.py\", line 785, in <module>\r\n File \"/tmp/ansible_community.general.vmadm_payload_jpca_c47/ansible_community.general.vmadm_payload.zip/ansible_collections/community/general/plugins/modules/vmadm.py\", line 730, in main\r\n File \"/tmp/ansible_community.general.vmadm_payload_jpca_c47/ansible_community.general.vmadm_payload.zip/ansible_collections/community/general/plugins/modules/vmadm.py\", line 441, in get_vm_uuid\r\nIndexError: Replacement index 1 out of range for positional args tuple\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} ```
done! |
Co-authored-by: Felix Fontein <felix@fontein.de>
Backport to stable-5: 💚 backport PR created✅ Backport PR branch: Backported as #5634 🤖 @patchback |
@cneira thanks for fixing this! |
* Fix for vmadm get_vm_uuid out of range * Fix for vmadm get_vm_uuid out of range * Update changelogs/fragments/5628-fix-vmadm-off-by-one.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit b8545d1)
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #5635 🤖 @patchback |
* Fix for vmadm get_vm_uuid out of range * Fix for vmadm get_vm_uuid out of range * Update changelogs/fragments/5628-fix-vmadm-off-by-one.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit b8545d1)
* Fix for vmadm get_vm_uuid out of range * Fix for vmadm get_vm_uuid out of range * Update changelogs/fragments/5628-fix-vmadm-off-by-one.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit b8545d1) Co-authored-by: Carlos Neira <cneirabustos@gmail.com>
* Fix for vmadm get_vm_uuid out of range * Fix for vmadm get_vm_uuid out of range * Update changelogs/fragments/5628-fix-vmadm-off-by-one.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit b8545d1) Co-authored-by: Carlos Neira <cneirabustos@gmail.com>
SUMMARY
Method get_vm_uuid from vmadm off-by-one error.
ISSUE TYPE
COMPONENT NAME
vmadm
ADDITIONAL INFORMATION
When running a playbook using the vmadm module results in:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: IndexError: Replacement index 1 out of range for positional args tuple fatal: [192.168.1.111]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 192.168.1.111 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/root/.ansible/tmp/ansible-tmp-1669747224.152739-62818-126536782663630/AnsiballZ_vmadm.py\", line 107, in <module>\r\n _ansiballz_main()\r\n File \"/root/.ansible/tmp/ansible-tmp-1669747224.152739-62818-126536782663630/AnsiballZ_vmadm.py\", line 99, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/root/.ansible/tmp/ansible-tmp-1669747224.152739-62818-126536782663630/AnsiballZ_vmadm.py\", line 47, in invoke_module\r\n runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.vmadm', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.vmadm', _modlib_path=modlib_path),\r\n File \"/opt/tools/lib/python3.10/runpy.py\", line 224, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/opt/tools/lib/python3.10/runpy.py\", line 96, in _run_module_code\r\n _run_code(code, mod_globals, init_globals,\r\n File \"/opt/tools/lib/python3.10/runpy.py\", line 86, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_community.general.vmadm_payload_jpca_c47/ansible_community.general.vmadm_payload.zip/ansible_collections/community/general/plugins/modules/vmadm.py\", line 785, in <module>\r\n File \"/tmp/ansible_community.general.vmadm_payload_jpca_c47/ansible_community.general.vmadm_payload.zip/ansible_collections/community/general/plugins/modules/vmadm.py\", line 730, in main\r\n File \"/tmp/ansible_community.general.vmadm_payload_jpca_c47/ansible_community.general.vmadm_payload.zip/ansible_collections/community/general/plugins/modules/vmadm.py\", line 441, in get_vm_uuid\r\nIndexError: Replacement index 1 out of range for positional args tuple\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}