add class

This commit is contained in:
Jeffrey C. Ollie 2023-12-07 19:47:17 -06:00
parent 95e978451b
commit 78789b68ea
Signed by: jeff
GPG key ID: 6F86035A6D97044E

View file

@ -4,6 +4,7 @@ import ipaddress
import json
import os
import pathlib
import re
import click
import pynetbox
@ -51,6 +52,7 @@ def main():
"manufacturer": device.device_type.manufacturer.name,
"model": device.device_type.model,
"part_number": device.device_type.part_number,
"class": re.sub(r"[^a-zA-Z0-9_]", "_", name),
}
print(name, str(ipaddress.ip_interface(device.primary_ip4.address).ip))
@ -82,6 +84,7 @@ def main():
"manufacturer": device.device_type.manufacturer.name,
"model": device.device_type.model,
"part_number": device.device_type.part_number,
"class": re.sub(r"[^a-zA-Z0-9_]", "_", name),
}
print(name, str(ipaddress.ip_interface(device.primary_ip4.address).ip))