From bbfdb2142951a2f943b99fa164899b716134eec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Solbj=C3=B8rg?= Date: Wed, 22 Mar 2023 20:36:43 +0100 Subject: feat(create-switch): Show more devices in distro list --- tools/netbox/scripts/create-switch/create-switch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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( -- cgit v1.2.3