Skip to content
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

Some tests are failing on ansible-devel #1121

Closed
BGmot opened this issue Nov 12, 2023 · 6 comments · Fixed by #1127
Closed

Some tests are failing on ansible-devel #1121

BGmot opened this issue Nov 12, 2023 · 6 comments · Fixed by #1127
Assignees

Comments

@BGmot
Copy link
Collaborator

BGmot commented Nov 12, 2023

https://github.com/ansible-collections/community.zabbix/actions/runs/6832220884/job/18584597155

@BGmot BGmot self-assigned this Nov 12, 2023
@BGmot
Copy link
Collaborator Author

BGmot commented Nov 12, 2023

Importing CertificateError works with Ansible 2.15:

$ ansible --version
ansible [core 2.15.0]
  config file = None
  configured module search path = ['/home/ey/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ey/env_py310_ans215/lib/python3.10/site-packages/ansible
  ansible collection location = /home/ey/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ey/env_py310_ans215/bin/ansible
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/home/ey/env_py310_ans215/bin/python)
  jinja version = 3.1.2
  libyaml = True
$ python
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ansible.module_utils.urls import CertificateError
>>> 

but broken with Ansible devel:

$ ansible --version
[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing
source of code and can become unstable at any point.
ansible [core 2.17.0.dev0]
  config file = None
  configured module search path = ['/home/ey/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ey/env_py310_ansdevel/lib/python3.10/site-packages/ansible
  ansible collection location = /home/ey/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ey/env_py310_ansdevel/bin/ansible
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/home/ey/env_py310_ansdevel/bin/python3)
  jinja version = 3.1.2
  libyaml = True
$ python3
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ansible.module_utils.urls import CertificateError
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'CertificateError' from 'ansible.module_utils.urls' (/home/ey/env_py310_ansdevel/lib/python3.10/site-packages/ansible/module_utils/urls.py)
>>>

@BGmot
Copy link
Collaborator Author

BGmot commented Nov 12, 2023

Hi @pyrodie18, why do you thing CertificateError is deprecated?
RE: #1105

@pyrodie18
Copy link
Collaborator

Because it doesn't exist in devel.

@BGmot
Copy link
Collaborator Author

BGmot commented Nov 12, 2023

Yeah... it's not actually Anisble thing. In an effort to deprecate Ansible compatibility with Python2 hey removed importing into ansible.module_utils.urls (though I am not sure how it is related) where we were taking it from but it remained "in tact" in ssl, this works without any problem

from ssl import CertificateError

Do you mind I'll revert your change?

@pyrodie18
Copy link
Collaborator

If you revert it's gonna break unless you plan on reverting and fixing

@BGmot
Copy link
Collaborator Author

BGmot commented Nov 12, 2023

yes sure with fixing, I just want to keep using CertificateError exception. It's very informative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants