You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collection will throw an error saying that 'cohesity_common_argument_spec' is undefined.
"Traceback (most recent call last):\n File \"/runner/.ansible/tmp/ansible-tmp-1726482479.5260842-22-9790455554391/AnsiballZ_cohesity_facts.py\", line 107, in <module>\n _ansiballz_main()\n File \"/runner/.ansible/tmp/ansible-tmp-1726482479.5260842-22-9790455554391/AnsiballZ_cohesity_facts.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/runner/.ansible/tmp/ansible-tmp-1726482479.5260842-22-9790455554391/AnsiballZ_cohesity_facts.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.cohesity.dataprotect.plugins.modules.cohesity_facts', init_globals=dict(_module_fqn='ansible_collections.cohesity.dataprotect.plugins.modules.cohesity_facts', _modlib_path=modlib_path),\n File \"<frozen runpy>\", line 226, in run_module\n File \"<frozen runpy>\", line 98, in _run_module_code\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/tmp/ansible_cohesity.dataprotect.cohesity_facts_payload_7ut553sr/ansible_cohesity.dataprotect.cohesity_facts_payload.zip/ansible_collections/cohesity/dataprotect/plugins/modules/cohesity_facts.py\", line 241, in <module>\n File \"/tmp/ansible_cohesity.dataprotect.cohesity_facts_payload_7ut553sr/ansible_cohesity.dataprotect.cohesity_facts_payload.zip/ansible_collections/cohesity/dataprotect/plugins/modules/cohesity_facts.py\", line 152, in main\nNameError: name 'cohesity_common_argument_spec' is not defined\n"
To Reproduce
(Write your steps here:)
Install Ansible 2.17+
Run any module (as far as I know)
Expected behavior
I expect get__cohesity_auth__token to work
Actual Behavior
Issue seems to be due to Python2 being removed from Ansible in version 2.17. When Python2 was removed, so was 'urllib_error' from ansible.module_utils.urls. This function is imported in cohesity_auth, but the error is thrown for cohesity_common_argument_spec because you have wrapped them in the same try except so that the import of all the preceeding functions are skipped.
try:
from ansible_collections.cohesity.dataprotect.plugins.module_utils.cohesity_auth import (
get__cohesity_auth__token,
)
from ansible_collections.cohesity.dataprotect.plugins.module_utils.cohesity_utilities import (
cohesity_common_argument_spec,
)
from ansible_collections.cohesity.dataprotect.plugins.module_utils.cohesity_hints import (
get__cluster,
get__nodes,
get_cohesity_client,
get__prot_source__all,
get__prot_policy__all,
get__prot_job__all,
get__storage_domain_id__all,
get__protection_run__all,
)
except Exception:
pass
Collection needs to be updated and remove all python2 references
The text was updated successfully, but these errors were encountered:
🐛 Bug Report
Collection will throw an error saying that 'cohesity_common_argument_spec' is undefined.
"Traceback (most recent call last):\n File \"/runner/.ansible/tmp/ansible-tmp-1726482479.5260842-22-9790455554391/AnsiballZ_cohesity_facts.py\", line 107, in <module>\n _ansiballz_main()\n File \"/runner/.ansible/tmp/ansible-tmp-1726482479.5260842-22-9790455554391/AnsiballZ_cohesity_facts.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/runner/.ansible/tmp/ansible-tmp-1726482479.5260842-22-9790455554391/AnsiballZ_cohesity_facts.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.cohesity.dataprotect.plugins.modules.cohesity_facts', init_globals=dict(_module_fqn='ansible_collections.cohesity.dataprotect.plugins.modules.cohesity_facts', _modlib_path=modlib_path),\n File \"<frozen runpy>\", line 226, in run_module\n File \"<frozen runpy>\", line 98, in _run_module_code\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/tmp/ansible_cohesity.dataprotect.cohesity_facts_payload_7ut553sr/ansible_cohesity.dataprotect.cohesity_facts_payload.zip/ansible_collections/cohesity/dataprotect/plugins/modules/cohesity_facts.py\", line 241, in <module>\n File \"/tmp/ansible_cohesity.dataprotect.cohesity_facts_payload_7ut553sr/ansible_cohesity.dataprotect.cohesity_facts_payload.zip/ansible_collections/cohesity/dataprotect/plugins/modules/cohesity_facts.py\", line 152, in main\nNameError: name 'cohesity_common_argument_spec' is not defined\n"
To Reproduce
(Write your steps here:)
Expected behavior
I expect get__cohesity_auth__token to work
Actual Behavior
Issue seems to be due to Python2 being removed from Ansible in version 2.17. When Python2 was removed, so was 'urllib_error' from ansible.module_utils.urls. This function is imported in cohesity_auth, but the error is thrown for cohesity_common_argument_spec because you have wrapped them in the same try except so that the import of all the preceeding functions are skipped.
The text was updated successfully, but these errors were encountered: