derlucas / snipeit-netbox

This Software can sync Data from SnipeIt to NetBox.
15 stars 5 forks source link

it is posible to fix my problem, that happened while importing the first asset from snipe #2

Closed Salise05 closed 1 month ago

Salise05 commented 4 months ago

Traceback (most recent call last): File "/home/netboxuser/main.py", line 40, in syncer.sync_assets_to_devices(assets) File "/home/netboxuser/syncer.py", line 415, in sync_assets_to_devices self.sync_device(nb_device_type, nb_tenant, netbox_devices, role, site, snipe_asset) File "/home/netboxuser/syncer.py", line 486, in sync_device self.__update_device(device, snipe_asset, nb_role, nb_site, nb_tenant, nb_device_type, False) File "/home/netboxuser/syncer.py", line 437, in __update_device if nb_device['device_role']['id'] != nb_role['id']:


  File "/home/netboxuser/venv/lib/python3.11/site-packages/pynetbox/core/response.py", line 323, in __getitem__
    return dict(self)[k]
           ~~~~~~~~~~^^^
KeyError: 'device_role'
derlucas commented 3 months ago

I did not check it, but i think this is due to changes in newer Netbox, i will have to update my script to run with the current Netbox Version

Salise05 commented 3 months ago

Perfect thanks to you, the update has helped, I no longer get an error message