Error removing "connected_endpoints" from interface #7389

Closed
opened 2025-12-29 20:22:46 +01:00 by adam · 0 comments
Owner

Originally created by @balpoint on GitHub (Dec 19, 2022).

NetBox version

v3.4.1

Python version

3.8

Steps to Reproduce

Using a custom script to default interfaces but not being able to set the connected_endpoints to nothing:

The part of the script where the interface is getting updated

Part of code

interface.enabled = False 
interface.description = ''
interface.mtu = None
interface.mac_address = None
interface.lag = None
interface.mode = ''
interface.untagged_vlan = None
interface.tagged_vlans.set([])
interface.ip_addresses.set([])
interface.tags.set([])
interface.cable = None
interface.cable_end = ''
interface.connected_endpoints.set([])
interface.save()

Expected Behavior

The removal of the "connection" field in the gui

Observed Behavior

Error

An exception occurred: AttributeError: 'list' object has no attribute 'set'

Traceback (most recent call last):
File "/opt/netbox/netbox/extras/scripts.py", line 464, in _run_script
script.output = script.run(data=data, commit=commit)
File "/opt/netbox-scripts/daniel.py", line 148, in run
interface.connected_endpoints.set([])
AttributeError: 'list' object has no attribute 'set'

I've looked at the debug window but cannot find a stracktrace or something pointing me in the right direction, so maybe somebody here knows how to clear the connected_endpoints.

Originally created by @balpoint on GitHub (Dec 19, 2022). ### NetBox version v3.4.1 ### Python version 3.8 ### Steps to Reproduce Using a custom script to default interfaces but not being able to set the connected_endpoints to nothing: The part of the script where the interface is getting updated ### Part of code ``` interface.enabled = False interface.description = '' interface.mtu = None interface.mac_address = None interface.lag = None interface.mode = '' interface.untagged_vlan = None interface.tagged_vlans.set([]) interface.ip_addresses.set([]) interface.tags.set([]) interface.cable = None interface.cable_end = '' interface.connected_endpoints.set([]) interface.save() ``` ### Expected Behavior The removal of the "connection" field in the gui ### Observed Behavior ### Error An exception occurred: AttributeError: 'list' object has no attribute 'set' Traceback (most recent call last): File "/opt/netbox/netbox/extras/scripts.py", line 464, in _run_script script.output = script.run(data=data, commit=commit) File "/opt/netbox-scripts/daniel.py", line 148, in run interface.connected_endpoints.set([]) AttributeError: 'list' object has no attribute 'set' I've looked at the debug window but cannot find a stracktrace or something pointing me in the right direction, so maybe somebody here knows how to clear the connected_endpoints.
adam added the type: bug label 2025-12-29 20:22:46 +01:00
adam closed this issue 2025-12-29 20:22:46 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7389