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
247 stars 74 forks source link

Fail to import device types when specifying slugs #137

Open BorisBachere opened 1 month ago

BorisBachere commented 1 month ago

Example extracted from .env:

SLUGS=cisco-n9k-c93360yc-fx2
VENDORS=Cisco

Below error appends:

Traceback (most recent call last):
  File "/home/bbacspy8/projects2/Device-Type-Library-Import/./nb-dt-import.py", line 54, in <module>
    main()
  File "/home/bbacspy8/projects2/Device-Type-Library-Import/./nb-dt-import.py", line 32, in main
    module_types = settings.dtl_repo.parse_files(files, slugs=args.slugs)
  File "/home/bbacspy8/projects2/Device-Type-Library-Import/repo.py", line 111, in parse_files
    if slugs and True not in [
  File "/home/bbacspy8/projects2/Device-Type-Library-Import/repo.py", line 112, in <listcomp>
    True if s.casefold() in data["slug"].casefold() else False for s in slugs
KeyError: 'slug'