Cable termination update via API results in empty trace and "connection" column on device interfaces page #8813

Closed
opened 2025-12-29 20:41:34 +01:00 by adam · 2 comments
Owner

Originally created by @PackeTsar on GitHub (Nov 7, 2023).

NetBox version

v3.6.4

Python version

3.10

Steps to Reproduce

  1. Create two devices and some interfaces on each
  2. Create a cable between two of the interfaces
  3. Use the below pynetbox script to update a termination of one side of the cable to an interface on a different device
orig_switch = nb.dcim.devices.get(name='OLD_SWITCH')
new_switch = nb.dcim.devices.get(name='NEW_SWITCH')
cable_label = 'C001916'
port_name = 'Ethernet1/5'

new_intf = list(nb.dcim.interfaces.filter(device_id=new_switch.id,
                                          name=port_name
                                          ))[0]

cable = nb.dcim.cables.get(label=cable_label)

if cable.a_terminations[0].device == orig_switch:
    print('Moving A term')
    cable.a_terminations = [{'object_type': 'dcim.interface', 'object_id': new_intf.id}]
else:
    print('Moving B term')
    cable.b_terminations = [{'object_type': 'dcim.interface', 'object_id': new_intf.id}]

cable.save()

Expected Behavior

Cable termination should be updated. Interfaces page on the new device should show the remote device and interface name in the "Connection" column.

Observed Behavior

Cable gets updated and cable label shows up on new device interfaces page. But "Connection" column is empty and the cable's trace page is empty.

Originally created by @PackeTsar on GitHub (Nov 7, 2023). ### NetBox version v3.6.4 ### Python version 3.10 ### Steps to Reproduce 1. Create two devices and some interfaces on each 2. Create a cable between two of the interfaces 3. Use the below pynetbox script to update a termination of one side of the cable to an interface on a different device ```py orig_switch = nb.dcim.devices.get(name='OLD_SWITCH') new_switch = nb.dcim.devices.get(name='NEW_SWITCH') cable_label = 'C001916' port_name = 'Ethernet1/5' new_intf = list(nb.dcim.interfaces.filter(device_id=new_switch.id, name=port_name ))[0] cable = nb.dcim.cables.get(label=cable_label) if cable.a_terminations[0].device == orig_switch: print('Moving A term') cable.a_terminations = [{'object_type': 'dcim.interface', 'object_id': new_intf.id}] else: print('Moving B term') cable.b_terminations = [{'object_type': 'dcim.interface', 'object_id': new_intf.id}] cable.save() ``` ### Expected Behavior Cable termination should be updated. Interfaces page on the new device should show the remote device and interface name in the "Connection" column. ### Observed Behavior Cable gets updated and cable label shows up on new device interfaces page. But "Connection" column is empty and the cable's trace page is empty.
adam added the type: bugstatus: revisions needed labels 2025-12-29 20:41:34 +01:00
adam closed this issue 2025-12-29 20:41:34 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 7, 2023):

We are unable to accept bug reports that involve third party tools. Please provide the raw REST API request someone can use to reproduce the reported behavior.

@jeremystretch commented on GitHub (Nov 7, 2023): We are unable to accept bug reports that involve third party tools. Please provide the raw REST API request someone can use to reproduce the reported behavior.
Author
Owner

@jeremystretch commented on GitHub (Dec 5, 2023):

This issue is being closed as no further information has been provided. If you would like to revisit this topic, please first modify your original post to include all the requested detail, and then ask that the issue be reopened.

@jeremystretch commented on GitHub (Dec 5, 2023): This issue is being closed as no further information has been provided. If you would like to revisit this topic, please first modify your original post to include all the requested detail, and then ask that the issue be reopened.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8813