diff options
author | Håkon Solbjørg <hakon@solbj.org> | 2023-03-22 20:36:43 +0100 |
---|---|---|
committer | Håkon Solbjørg <hakon@solbj.org> | 2023-03-22 20:36:43 +0100 |
commit | bbfdb2142951a2f943b99fa164899b716134eec8 (patch) | |
tree | 33c0f2d2dc79b3de67a139f73fae4a187fc8788d /tools/netbox/scripts/create-switch/create-switch.py | |
parent | e49cdda4d5664f6c53bcb41a11dea620eab239f5 (diff) |
feat(create-switch): Show more devices in distro list
Diffstat (limited to 'tools/netbox/scripts/create-switch/create-switch.py')
-rw-r--r-- | tools/netbox/scripts/create-switch/create-switch.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/netbox/scripts/create-switch/create-switch.py b/tools/netbox/scripts/create-switch/create-switch.py index 6c442e1..4945013 100644 --- a/tools/netbox/scripts/create-switch/create-switch.py +++ b/tools/netbox/scripts/create-switch/create-switch.py @@ -9,6 +9,8 @@ from ipam.models import IPAddress, Prefix, VLAN, VLANGroup # Used for getting existing types/objects from Netbox. DISTRIBUTION_SWITCH_DEVICE_ROLE = 'distribution-switch' # match the name or the slug +ROUTER_DEVICE_ROLE = 'router' +CORE_DEVICE_ROLE = 'core' ACCESS_SWITCH_DEVICE_ROLE = DeviceRole.objects.get(name='Access Switch') DEFAULT_SITE = Site.objects.first() # TODO: pick default site ? @@ -40,7 +42,7 @@ class CreateSwitch(Script): description = "Destination/uplink", model=Device, query_params={ - 'role': DISTRIBUTION_SWITCH_DEVICE_ROLE, + 'role': [DISTRIBUTION_SWITCH_DEVICE_ROLE, ROUTER_DEVICE_ROLE, CORE_DEVICE_ROLE], }, ) destination_interfaces = MultiObjectVar( |