Device-Type-Library-Import
Device-Type-Library-Import copied to clipboard
container image exits with AttributeError
I installed netbox on k8s with the helm chart, and then ran this importer like so:
apiVersion: batch/v1
kind: Job
metadata:
name: devlib-importer
spec:
template:
spec:
restartPolicy: Never
containers:
- name: "devlib-importer"
image: "ghcr.io/minitriga/netbox-device-type-library-import"
env:
- name: VENDORS
value: "Cisco"
- name: NETBOX_URL
value: "http://my-release-netbox.default.svc.cluster.local/"
- name: NETBOX_TOKEN
valueFrom:
secretKeyRef:
name: my-release-netbox-superuser
key: api_token
It ran for a while and imported 682 Cisco devices. Maybe that's all of them? The total output is 25,034 lines, and these are the last lines it output:
Module Type Created: Cisco - Nexus 6001 4xQSFP Ethernet Module - 9
Interface Template Created: Ethernet{module}/1 - QSFP+ (40GE) - 9 - 1649
Interface Template Created: Etherne{module}/2 - QSFP+ (40GE) - 9 - 1650
Interface Template Created: Ethernet{module}/3 - QSFP+ (40GE) - 9 - 1651
Interface Template Created: Ethernet{module}/4 - QSFP+ (40GE) - 9 - 1652
Module Type Created: Cisco - N77-AC-3KW - 10
Power Port Template Exists: PSU{module} - C14 - 6 - 55
Module Type Created: Cisco - N77-C7706-FAB-2 - 11
Module Type Created: Cisco - N77-C7706-FAN - 12
Module Type Created: Cisco - N77-SUP2E - 13
Traceback (most recent call last):
File "/app/nb-dt-import.py", line 853, in <module>
main()
File "/app/nb-dt-import.py", line 841, in main
create_module_types(module_types, nb)
File "/app/nb-dt-import.py", line 746, in create_module_types
create_module_interfaces(curr_mt["interfaces"],
File "/app/nb-dt-import.py", line 230, in create_module_interfaces
+ f' - {if_res.module_type.id} - {if_res.id}')
AttributeError: 'NoneType' object has no attribute 'id'
Apparently the current container image was published "over two years ago", so perhaps the first step is to get that updated and establish a build trigger so it'll stay current.