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 create BGP Session object using pynetbox, when peer_group is supplied in the args #46
Comments
I would add that the problem is not just during creation. If I create the BGP Session object without relating it any Peer Group, and later try to update the Session object, I get the same error.
|
Both creating and updating a BGP Session with Peer Group, works fine over the GUI. The problem only seems to be when pynetbox is used to either create/update BGP session with a related peer_group. Also, removing a related peer_group from a BGP session works fine over the pynetbox client/API. |
I have dug into this bug and found the reason. There is some problem in rest_framework with nested serializer and unique together validation. I found the workaround to fix the problem: remove validation for the nested serializer, but I afraid it can have some side effects. You can use this fix https://github.com/k01ek/netbox-bgp/tree/quick-fix-46 |
Thank you @k01ek |
What is the impact of rolling this fix into the master branch @k01ek ? After all, the change is restricted only to BGP Peer Group Serializer |
Just ran in to this as well. I've just avoided peer groups for the short term until this can be further tested and rolled in to master. |
yeah, I'm doing the same for the time being. Can't wait for it to get rolled into the master branch |
Sorry guys, I was on vacation. Will update it soon. |
NetBox version
2.11.2
Describe the bug
Unable to create BGP Session object using pynetbox, when peer_group is supplied in the args.
To Reproduce
nb_staging in the output below is my instance of pynetbox.api
Expected behavior
The BGP Session object gets created
Screenshots
n/a - the traceback above should be sufficient.
Additional context
I have also tried changing
object_dict['peer_group'] = {'name': 'TRANSIT'}
but I still get the same error. Neither referencing related object by a dictionary of attributes nor by its ID seem to work.
If I remove the 'peer_group' key from object_dict altogether, the BGP session object gets created successfully. However, thats not what I would like. I'd like to relate the session to a peer group.
The text was updated successfully, but these errors were encountered: