netbox-community / Device-Type-Library-Import

This library is intended to assist with importing device and module types into NetBox from the NetBox Community DeviceType-Library
https://github.com/netbox-community/devicetype-library
MIT License
270 stars 89 forks source link

Errors parsing netbox Version info #124

Closed dBitech closed 8 months ago

dBitech commented 8 months ago

When attempting to run nb-dt-import, the script fails against netbox 3.7.1 in the following way:

(venv) netbox@netbox-01 /opt/Device-Type-Library-Import# ./nb-dt-import.py
Package devicetype-library is already installed, updating /opt/Device-Type-Library-Import/repo
Traceback (most recent call last):
  File "/opt/Device-Type-Library-Import/./nb-dt-import.py", line 54, in <module>
    main()
  File "/opt/Device-Type-Library-Import/./nb-dt-import.py", line 17, in main
    netbox = NetBox(settings)
             ^^^^^^^^^^^^^^^^
  File "/opt/Device-Type-Library-Import/netbox_api.py", line 28, in __init__
    self.verify_compatibility()
  File "/opt/Device-Type-Library-Import/netbox_api.py", line 50, in verify_compatibility
    version_split = [int(x) for x in self.netbox.version.split('.')]
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/Device-Type-Library-Import/netbox_api.py", line 50, in <listcomp>
    version_split = [int(x) for x in self.netbox.version.split('.')]
                     ^^^^^^
ValueError: invalid literal for int() with base 10: ''
(venv) netbox@netbox-01 /opt/Device-Type-Library-Import# 
dBitech commented 8 months ago

Resolved, this was a http vs https issue