Skip to content

Mac address can not be unset via API #12412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amhn opened this issue May 1, 2023 · 0 comments
Closed

Mac address can not be unset via API #12412

amhn opened this issue May 1, 2023 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@amhn
Copy link
Contributor

amhn commented May 1, 2023

NetBox version

v3.5.0

Python version

3.11

Steps to Reproduce

  1. Create VM Interface with mac address set
  2. Try removing the mac address with null:
curl \
-H "Authorization: Token $NETBOX_TOKEN" \
-H "Content-type: application/json" \
$NETBOX_SCHEME://$NETBOX_URL/api/virtualization/interfaces/4/ \
-X PATCH \
--data '{"mac_address": null}'
  1. Try removing the mac address with empty string:
curl \
-H "Authorization: Token $NETBOX_TOKEN" \
-H "Content-type: application/json" \
$NETBOX_SCHEME://$NETBOX_URL/api/virtualization/interfaces/4/ \
-X PATCH \
--data '{"mac_address": ""}'

Expected Behavior

Mac address can be set back to NULL via API

Observed Behavior

With step 2 the error message is {"mac_address":["This field may not be null."]}. With step 3 it is {"mac_address":["This field may not be blank."]}

Probably allow_null = True should be added to the mac_address field of the VMInterfaceSerializer (and InterfaceSerializer for device interfaces)

@amhn amhn added the type: bug A confirmed report of unexpected behavior in the application label May 1, 2023
@jeremystretch jeremystretch self-assigned this May 1, 2023
@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label May 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants