We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3758bc8 + 385c66e commit 21bd7f4Copy full SHA for 21bd7f4
startup_scripts/270_primary_ips.py
@@ -31,13 +31,14 @@ def link_primary_ip(assets, asset_model):
31
devices = load_yaml('/opt/netbox/initializers/devices.yml')
32
virtual_machines = load_yaml('/opt/netbox/initializers/virtual_machines.yml')
33
34
-if devices is None and virtual_machines is None:
35
- sys.exit()
36
-
37
optional_assocs = {
38
'primary_ip4': (IPAddress, 'address'),
39
'primary_ip6': (IPAddress, 'address')
40
}
41
42
-link_primary_ip(devices, Device)
43
-link_primary_ip(virtual_machines, VirtualMachine)
+if devices is None and virtual_machines is None:
+ sys.exit()
+if devices is not None:
+ link_primary_ip(devices, Device)
+if virtual_machines is not None:
44
+ link_primary_ip(virtual_machines, VirtualMachine)
0 commit comments