-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Labels
netboxseverity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
Deployment Type
Self-hosted
NetBox Version
v3.7.5, 4.0.3
Python Version
3.9
Steps to Reproduce
- Choose any interface.
- Set the interface's 801.1Q Mode to Tagged (all) (in API terms,
"mode": "tagged-all") - Use a
PATCHrequest to set a non-empty value for the interface'stagged_vlansproperty - Use a second
PATCHrequest to change only the interface'sdescriptionproperty, leavingtagged_vlansanduntagged_vlansout of the patch - Retrieve the interface via the API.
$ curl -X PATCH -H "Content-type: application/json" -H "Accept: application/json" -H "Authorization: Token $TOKEN" http://localhost/api/dcim/interfaces/1/ --data '{"description": "Patching the description and tagged_vlans", "tagged_vlans": [ 1 ] }'
$ curl -X PATCH -H "Content-type: application/json" -H "Accept: application/json" -H "Authorization: Token $TOKEN" http://localhost/api/dcim/interfaces/1/ --data '{"description": "Patching the description only" }'
Expected Behavior
The first PATCH should be rejected with an API error message indicating that setting tagged_vlan is not allowed on an interface with "mode": "tagged_all".
Observed Behavior
The first (invalid) PATCH is accepted, and reflected as specified. The second (valid) PATCH is accepted, and results in the unexpected obliteration of the tagged_vlan result.
Metadata
Metadata
Assignees
Labels
netboxseverity: lowDoes not significantly disrupt application functionality, or a workaround is availableDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application