-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Can not rename device interface templates through API - module_type, name must make a unique set #16466
Comments
@rozgonik can you please re-check the repo steps as it looks like it is working for me using the steps your provided. |
@arthanson I can repro it just fine, but here are the repro steps 100% through API (repro steps above are a mixed gui-api approach, maybe that was misleading, sorry for the confusion this may have caused):
Try to rename the second interface template ( |
@rozgonik I followed your steps but it is still working fine for me (tried against my local install) See commands / output below using your curl commands. For the step-4 my ID returned was 302 which I used.
|
@arthanson I can still reproduce it on a fresh source install from the develop branch (commit 7a5e8a8).
Please make sure your dependencies are correctly installed as I found out that downgrading Update: It seems like |
I think this drf issue may be related: encode/django-rest-framework#9410 |
This is a reminder that additional information is needed in order to further triage this issue. If the requested details are not provided, the issue will soon be closed automatically. |
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. |
Can someone please reopen it? What details can I provide to help on reproducing this issue? |
I can confirm that the issue is also still present in v4.0.7. And it doesn't only apply to device interface templates, but also to device console port templates. It seems the unique name check isn't done on the device itself as it should, but on the entire template database. Edit: to be clear: I use the swagger "Try it out" feature |
Deployment Type
Self-hosted
NetBox Version
v4.0.5 - netbox-docker
Python Version
3.11
Steps to Reproduce
Netbox is running as a docker container with postgres12. The behaviour can be reproduced in the demo environment too.
Preparation:
asd
andqwe
ge1
for the first device type with arbitrary parametersge2
for the second device type with arbitrary parametersTry to rename the second interface template to
ge1
through the API (I have used the swagger "Try it out" feature):curl -X 'PATCH' 'https://demo.netbox.dev/api/dcim/interface-templates/305/' [...] -d '{"name": "ge1"}'
Expected Behavior
The interface template is successfully renamed, the PATCH call returning HTTP 200.
Observed Behavior
HTTP 400 returned with body:
The text was updated successfully, but these errors were encountered: