Device-Type-Library-Import icon indicating copy to clipboard operation
Device-Type-Library-Import copied to clipboard

unable to use it with netbox 4.5.x

Open Wuppi68 opened this issue 8 months ago • 2 comments

i want to import into a fresh installation and get the following errors - ignoring HTTPS warnings:

Package devicetype-library is already installed, updating /home/ralf/Device-Type-Library-Import/repo
*** deleted 2 SSL warnings
Netbox version 4.5 found. Using new filters.
*** deleted 2 SSL warnings
  warnings.warn(
Traceback (most recent call last):
  File "/home/xxx/Device-Type-Library-Import/./nb-dt-import.py", line 54, in <module>
    main()
  File "/home/xxx/Device-Type-Library-Import/./nb-dt-import.py", line 17, in main
    netbox = NetBox(settings)
             ^^^^^^^^^^^^^^^^
  File "/home/xxx/Device-Type-Library-Import/netbox_api.py", line 31, in __init__
    self.device_types = DeviceTypes(self.netbox, self.handle, self.counter, self.ignore_ssl, self.new_filters)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xxx/Device-Type-Library-Import/netbox_api.py", line 196, in __init__
    self.existing_device_types = self.get_device_types()
                                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xxx/Device-Type-Library-Import/netbox_api.py", line 201, in get_device_types
    return {str(item): item for item in self.netbox.dcim.device_types.all()}
            ^^^^^^^^^
  File "/home/xxx/Device-Type-Library-Import/venv/lib/python3.12/site-packages/pynetbox/models/dcim.py", line 64, in __str__
    return self.model
           ^^^^^^^^^^
  File "/home/xxx/Device-Type-Library-Import/venv/lib/python3.12/site-packages/pynetbox/core/response.py", line 328, in __getattr__
    raise AttributeError('object has no attribute "{}"'.format(k))
AttributeError: object has no attribute "model"

I have tried pip3 install -r requirements.txt with no version information too --> same result

any advise?

Wuppi68 avatar Mar 27 '26 10:03 Wuppi68

update with no success created a manufacturer and a device type to get some data inside --> no success - same as above

Wuppi68 avatar Mar 27 '26 10:03 Wuppi68

I'm also having issues with Netbox v4.5.5. I'm trying to import HPE vendor specifically

./nb-dt-import.ph --vendors HPE

Modules Enabled. Creating Modules... 1 Module Vendors Found 188 Module-Types Found Error '{"all":["Module type with this Manufacturer and Model already exists."]}' creating module type: {'manufacturer': {'name': 'HPE', 'slug': 'hpe'}, 'model': 'HPE Drive LTO-7 Ultrium 7-SCSI', 'part_number': '834167-001', 'comments': 'HPE StoreEver MSL LTO-7 Ultrium 15000 SAS Drive', 'description': 'Produits compatibles : StoreEver MSL 1/8 Autoloader, StoreEver MSL2024, StoreEver MSL4048, StoreEver MSL3040, StoreEver MSL6480', 'interfaces': [{'name': 'SAS/{module}/1', 'type': 'other'}, {'name': 'SAS/{module}/2', 'type': 'other'}], 'src': '/root/Device-Type-Library-Import/repo/module-types/HPE/834167-001.yaml'}

0 devices created 328 images uploaded 2 interfaces/ports updated 0 manufacturers created

hursjohn avatar Mar 31 '26 18:03 hursjohn