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
Run a module that checks the NetBox version against the NetBox-Docker version starting from 3.2.0 . In my case at least the netbox_rack is affected.
Expected Behavior
Should work as before.
Observed Behavior
Running the netbox_rack module against the Docker version of NetBox seems to fails with the following error:
[...]
The full traceback is:
Traceback (most recent call last):
File "master:/home/riyad/Projects/ansible-netbox/library/mitogen/ansible_mitogen/runner.py", line 1039, in _run
self._run_code(code, mod)
File "master:/home/riyad/Projects/ansible-netbox/library/mitogen/ansible_mitogen/runner.py", line 1003, in _run_code
exec(code, vars(mod))
File "master:/home/riyad/.ansible/collections/ansible_collections/netbox/netbox/plugins/modules/netbox_rack.py", line 346, in <module>
File "master:/home/riyad/.ansible/collections/ansible_collections/netbox/netbox/plugins/modules/netbox_rack.py", line 342, in main
File "master:/home/riyad/.ansible/collections/ansible_collections/netbox/netbox/plugins/module_utils/netbox_dcim.py", line 130, in run
if Version(self.full_version) >= Version("4.1.0"):
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/riyad/Projects/ansible-netbox/.venv/lib/python3.12/site-packages/packaging/version.py", line 202, in __init__
raise InvalidVersion(f"Invalid version: {version!r}")
packaging.version.InvalidVersion: Invalid version: '4.2.3-Docker-3.2.0'
[...]
This started after updating to version 3.2.0 of the NetBox-Docker project where it seems to have started to include its version number in the version string as well (i.e. "4.2.3-Docker-3.2.0").
I am getting something similar with netbox.netbox.netbox_virtual_machine and netbox.netbox.netbox_vm_interface modules, python3.12
"msg": "Failed to establish connection to NetBox API"
The full traceback is:
File "/var/folders/s4/bh0s3kz51g166t27lwwz9zbw0000gp/T/ansible_netbox.netbox.netbox_virtual_machine_payload_oguhsl20/ansible_netbox.netbox.netbox_virtual_machine_payload.zip/ansible_collections/netbox/netbox/plugins/module_utils/netbox_utils.py", line 811, in _connect_netbox_api
self.version = nb.version
^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/pynetbox/core/api.py", line 113, in version
).get_version()
^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/pynetbox/core/query.py", line 198, in get_version
raise RequestError(req)
Can I suggest you raise this issue with the netbox-docker repository? I find it a bit strange that the netbox-docker image changes the netbox-version in /api/status to indicate it's running a docker image. I would expect the netbox-version to be the actual netbox version running, not that the netbox version is running using docker.
Ansible NetBox Collection version
v3.20.0
Ansible version
NetBox version
4.2.3-Docker-3.2.0 (from https://github.com/netbox-community/netbox-docker)
Python version
3.11
Steps to Reproduce
Run a module that checks the NetBox version against the NetBox-Docker version starting from 3.2.0 . In my case at least the
netbox_rack
is affected.Expected Behavior
Should work as before.
Observed Behavior
Running the
netbox_rack
module against the Docker version of NetBox seems to fails with the following error:This started after updating to version 3.2.0 of the NetBox-Docker project where it seems to have started to include its version number in the version string as well (i.e.
"4.2.3-Docker-3.2.0"
).May be caused by netbox-community/netbox-docker#1380 ?
The text was updated successfully, but these errors were encountered: