add class
This commit is contained in:
parent
95e978451b
commit
78789b68ea
1 changed files with 3 additions and 0 deletions
|
@ -4,6 +4,7 @@ import ipaddress
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import re
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import pynetbox
|
import pynetbox
|
||||||
|
@ -51,6 +52,7 @@ def main():
|
||||||
"manufacturer": device.device_type.manufacturer.name,
|
"manufacturer": device.device_type.manufacturer.name,
|
||||||
"model": device.device_type.model,
|
"model": device.device_type.model,
|
||||||
"part_number": device.device_type.part_number,
|
"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))
|
print(name, str(ipaddress.ip_interface(device.primary_ip4.address).ip))
|
||||||
|
@ -82,6 +84,7 @@ def main():
|
||||||
"manufacturer": device.device_type.manufacturer.name,
|
"manufacturer": device.device_type.manufacturer.name,
|
||||||
"model": device.device_type.model,
|
"model": device.device_type.model,
|
||||||
"part_number": device.device_type.part_number,
|
"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))
|
print(name, str(ipaddress.ip_interface(device.primary_ip4.address).ip))
|
||||||
|
|
Loading…
Reference in a new issue