The Site ID variable on cable termination objects is not updated when nested locations are moved from one site to another. #8004

Closed
opened 2025-12-29 20:31:03 +01:00 by adam · 1 comment
Owner

Originally created by @Chiniquy on GitHub (May 4, 2023).

Originally assigned to: @arthanson on GitHub.

NetBox version

v.3.5.0

Python version

3.10

Steps to Reproduce

Create Site 1
Create Location 1 in Site 1
Create Sublocation 1 in Site 1 with Location 1 as parent
Create Rack 1 in Sublocation 1
Create Device 1 in Rack 1
Create Device 2 in Rack 1
Create an interface in each device
Create a cable linking these interfaces together

Create Site nr 2
Move Location 1 from Site 1 to Site 2
Delete Site 1

Expected Behavior

Site 1 should be deleted

Observed Behavior

Site is not deleted, even though it is empty.
Throws error
<class 'IndexError'>
list index out of range

Originally created by @Chiniquy on GitHub (May 4, 2023). Originally assigned to: @arthanson on GitHub. ### NetBox version v.3.5.0 ### Python version 3.10 ### Steps to Reproduce Create Site 1 Create Location 1 in Site 1 Create Sublocation 1 in Site 1 with Location 1 as parent Create Rack 1 in Sublocation 1 Create Device 1 in Rack 1 Create Device 2 in Rack 1 Create an interface in each device Create a cable linking these interfaces together Create Site nr 2 Move Location 1 from Site 1 to Site 2 Delete Site 1 ### Expected Behavior Site 1 should be deleted ### Observed Behavior Site is not deleted, even though it is empty. Throws error <class 'IndexError'> list index out of range
adam added the type: bugstatus: accepted labels 2025-12-29 20:31:03 +01:00
adam closed this issue 2025-12-29 20:31:03 +01:00
Author
Owner

@Chiniquy commented on GitHub (May 4, 2023):

It works as expected if we do not make Sublocation 1 but simply put the rack and equipment in Location 1, and then move Location 1 from Site 1 to Site 2.

It also works as expected after we delete the cable object after getting the IndexError.

@Chiniquy commented on GitHub (May 4, 2023): It works as expected if we do not make Sublocation 1 but simply put the rack and equipment in Location 1, and then move Location 1 from Site 1 to Site 2. It also works as expected after we delete the cable object after getting the IndexError.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8004