-
Notifications
You must be signed in to change notification settings - Fork 1
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
Unable to revert a branch that removed a device. #136
Comments
I tested, and I don't seem to have a problem removing a single cable termination, and reverting it. I'll have to run more testing, but seems to be an issue with reverting after merging a branch that deleted a device. |
@ewscott9 please modify your post above to include exact reproduction steps, beginning with the creation of any objects to be deleted. |
Thanks @jeremystretch I updated the reproduction steps. I did some additional testing, and it will revert a device delete unless there is a cable connection between 2 devices. |
I'm also getting an error when trying to merge a branch after I create a device that has an interface. I get a |
The root issue here appears to be the generic foreign key
The best approach here is probably to ensure any GFKs are populated on each object during deserialization, much as a form or API serializer would. |
How would I go about doing that? |
@ewscott9 sorry, that was a note on a potential solution for the bug, not something that you can do as a user. |
No problem. Thanks for looking into the issue. |
Another issue here is that the objects are serialized in the wrong order: <class 'dcim.models.devices.Device'> The interface needs to be deserialized after the CableTermination |
Plugin Version
0.5.0
NetBox Version
NetBox Community v4.1.0 (2024-09-03) (In Netbox-Docker-3.0.1)
Python Version
3.12.3
Steps to Reproduce
On main branch:
On Branch "test":
Expected Behavior
The branch should revert.
Observed Behavior
It fails when I try to revert the branch.
I get the following log for the revert branch job:
Seems like it's failing to recreate a cable connection
The text was updated successfully, but these errors were encountered: