Add more info to failed device_type creations (#81)

This commit is contained in:
Philipp Rintz 2023-03-09 16:01:42 +01:00 committed by GitHub
parent 542a56a947
commit e1e2d780bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -89,7 +89,9 @@ class NetBox:
self.handle.verbose_log(f'Device Type Created: {dt.manufacturer.name} - '
+ f'{dt.model} - {dt.id}')
except pynetbox.RequestError as e:
self.handle.log(e.error)
self.handle.log(f'Error {e.error} creating device type:'
f' {device_type["manufacturer"]["name"]} {device_type["model"]}')
continue
if "interfaces" in device_type:
self.device_types.create_interfaces(device_type["interfaces"], dt.id)

View File

@ -75,7 +75,7 @@ class DTLRepo:
vendor_dirs = os.listdir(base_path)
for folder in [vendor for vendor in vendor_dirs if not vendors or vendor.casefold() in vendors]:
if folder.casefold() is not "testing":
if folder.casefold() != "testing":
discovered_vendors.append({'name': folder,
'slug': self.slug_format(folder)})
for extension in self.yaml_extensions: