aboutsummaryrefslogtreecommitdiffstats
path: root/tools/netbox/scripts/create-switch/create-switch-tg25.py
diff options
context:
space:
mode:
authorSjur Fredriksen <sjurtf@ifi.uio.no>2025-02-16 20:53:00 +0100
committerSjur Fredriksen <sjurtf@ifi.uio.no>2025-02-16 20:53:00 +0100
commitf846beab93416ecf14992522829280910f4aed96 (patch)
tree76ae027786c3c04a5393a87760168d93b4308df4 /tools/netbox/scripts/create-switch/create-switch-tg25.py
parent7f77a3dd6b394d7145bbcb946afd95fcb80c4330 (diff)
take location from uplink device
Diffstat (limited to 'tools/netbox/scripts/create-switch/create-switch-tg25.py')
-rw-r--r--tools/netbox/scripts/create-switch/create-switch-tg25.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/tools/netbox/scripts/create-switch/create-switch-tg25.py b/tools/netbox/scripts/create-switch/create-switch-tg25.py
index f932bf4..746ce08 100644
--- a/tools/netbox/scripts/create-switch/create-switch-tg25.py
+++ b/tools/netbox/scripts/create-switch/create-switch-tg25.py
@@ -99,11 +99,6 @@ class CreateSwitch(Script):
model=DeviceRole,
default=DEFAULT_DEVICE_ROLE.id,
)
- location = ObjectVar(
- model=Location,
- required=True,
- default=Location.objects.get(name="Ringen") # Default during development
- )
uplink_type = MultiChoiceVar(
label='Uplink Type',
required=True,
@@ -284,7 +279,7 @@ class CreateSwitch(Script):
switch = Device(
name=switch_name,
device_type=data['device_type'],
- location=data['location'],
+ location=data['destination_device_a'].location,
role=data['device_role'],
site=DEFAULT_SITE
)