Interface description update (pynetbox 5.0.5) #4545

Closed
opened 2025-12-29 18:37:19 +01:00 by adam · 1 comment
Owner

Originally created by @sngx13 on GitHub (Feb 9, 2021).

Hi,

Looks like an update of interface descriptions is not working, I've followed few guides so far with the same result.

update_intf = nb.dcim.interfaces.get(intf_id)
update_intf.description = intf_descr
update_intf.save()

Getting the following error:

pynetbox.core.query.RequestError: The request failed with code 400 Bad Request: {'non_field_errors': ['Expected a list of items but got type "dict".']}

if update_intf.save is used instead of update_intf.save(), scripts succeeds but descriptions are not actually updated.

Interestingly when I do the same via Python3 interpreter it works:

>>> intf = nb.dcim.interfaces.get(3280)
>>> intf.serialize()
{'id': 3280, 'url': 'https://ipam.serviceworks.cloud/api/dcim/interfaces/3280/', 'device': 63, 'name': 'XGE1/0/1', 'label': '', 'type': '10gbase-x-sfpp', 'enabled': True, 'lag': None, 'mtu': None, 'mac_address': None, 'mgmt_only': False, 'description': 'testing...', 'mode': None, 'untagged_vlan': None, 'tagged_vlans': [], 'cable': None, 'cable_peer': None, 'cable_peer_type': None, 'connected_endpoint': None, 'connected_endpoint_type': None, 'connected_endpoint_reachable': None, 'tags': [211], 'count_ipaddresses': 0}
>>> intf.description = "Test-123"
>>> intf.save
>>> intf.serialize()
{'id': 3280, 'url': 'https://ipam.serviceworks.cloud/api/dcim/interfaces/3280/', 'device': 63, 'name': 'XGE1/0/1', 'label': '', 'type': '10gbase-x-sfpp', 'enabled': True, 'lag': None, 'mtu': None, 'mac_address': None, 'mgmt_only': False, 'description': 'Test-123', 'mode': None, 'untagged_vlan': None, 'tagged_vlans': [], 'cable': None, 'cable_peer': None, 'cable_peer_type': None, 'connected_endpoint': None, 'connected_endpoint_type': None, 'connected_endpoint_reachable': None, 'tags': [211], 'count_ipaddresses': 0}

Thank you

Originally created by @sngx13 on GitHub (Feb 9, 2021). Hi, Looks like an update of interface descriptions is not working, I've followed few guides so far with the same result. ``` update_intf = nb.dcim.interfaces.get(intf_id) update_intf.description = intf_descr update_intf.save() ``` Getting the following error: `pynetbox.core.query.RequestError: The request failed with code 400 Bad Request: {'non_field_errors': ['Expected a list of items but got type "dict".']}` if update_intf.save is used instead of update_intf.save(), scripts succeeds but descriptions are not actually updated. Interestingly when I do the same via Python3 interpreter it works: ``` >>> intf = nb.dcim.interfaces.get(3280) >>> intf.serialize() {'id': 3280, 'url': 'https://ipam.serviceworks.cloud/api/dcim/interfaces/3280/', 'device': 63, 'name': 'XGE1/0/1', 'label': '', 'type': '10gbase-x-sfpp', 'enabled': True, 'lag': None, 'mtu': None, 'mac_address': None, 'mgmt_only': False, 'description': 'testing...', 'mode': None, 'untagged_vlan': None, 'tagged_vlans': [], 'cable': None, 'cable_peer': None, 'cable_peer_type': None, 'connected_endpoint': None, 'connected_endpoint_type': None, 'connected_endpoint_reachable': None, 'tags': [211], 'count_ipaddresses': 0} >>> intf.description = "Test-123" >>> intf.save >>> intf.serialize() {'id': 3280, 'url': 'https://ipam.serviceworks.cloud/api/dcim/interfaces/3280/', 'device': 63, 'name': 'XGE1/0/1', 'label': '', 'type': '10gbase-x-sfpp', 'enabled': True, 'lag': None, 'mtu': None, 'mac_address': None, 'mgmt_only': False, 'description': 'Test-123', 'mode': None, 'untagged_vlan': None, 'tagged_vlans': [], 'cable': None, 'cable_peer': None, 'cable_peer_type': None, 'connected_endpoint': None, 'connected_endpoint_type': None, 'connected_endpoint_reachable': None, 'tags': [211], 'count_ipaddresses': 0} ``` Thank you
adam closed this issue 2025-12-29 18:37:19 +01:00
Author
Owner

@sngx13 commented on GitHub (Feb 9, 2021):

Turns out Netbox version and Pynetbox were out of sync version wise, updated both to latest and it worked as per docs.

@sngx13 commented on GitHub (Feb 9, 2021): Turns out Netbox version and Pynetbox were out of sync version wise, updated both to latest and it worked as per docs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4545