-
Notifications
You must be signed in to change notification settings - Fork 169
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
Update pynetbox to new tags in Netbox 2.9 #291
Conversation
Seems we would at least break what's preventing duplicate tags from being sent for pre-2.9 NetBox clients. I haven't had a chance to see what the behavior is like there with the current version either. Do you happen to know? Also we'd probably not want to alter the existing tests so we can ensure backwards compatibility and just make new ones for the 2.9+ behavior. |
This is the current behaviour when connecting to Netbox 2.9.3:
And then when you try to use a dict:
With this fix and Netbox 2.8.9, if you specify duplicate tags, the server will just dedupe them for you. Nothing bad seems to happen as far as i can tell. A hacky solution would be to de-dupe things that are hashable, and leave everything else as is. If this is something you'd like, I can update the PR. |
Nice!
hrm, maybe, I suspect the problem stems, in some part, from the default behavior here: https://github.com/digitalocean/pynetbox/blob/c45411a8b5749537baa91fb6bcc1321fa144a233/pynetbox/core/response.py#L342 |
That is correct. They were either strings or dicts in my tests. If you fetch a device from 2.9+ that contains existing tags, those will be How would you like to proceed here? |
Any news on this MR ? |
Right, please give an update if you intend to merge this anytime soon. I too am in a situation to port my applications to NB 2.9, and for that I need to know how the tag support is going to look like. Thanks. |
No, it needs some tweaks before merging. We'd, at least, need to continue testing the pre-2.9 behavior with strings. I'm not so sure we want to offload tag deduplication to the server either (assuming the 2.8+ behavior applies for earlier versions as well). In cases where client code was simply appending a tag we'd send an update every time it was run. |
I'm not sure this needs to be adressed. As a developer, I would consider it my responsibility to ensure which tags I wish to associate with an interface. This is, I would consider it my job to ensure I don't send duplicated tags to pynetbox/netbox if I don't want to see dupes. Besides, this anyway seems to be already the case as a convenient feature of Netbox itself. Moreover, I'd like to emphasize that right now pynetbox is not usable at all with NB 2.9, but the opposite is not true alike. If you'd be merging this code and this would cause duplication problems with outdated versions of Netbox, people can still downgrade pynetbox until they fixed their code. The reverse is not true, leaving me with a broken app I cannot fix unless I want to monkey-patch your library. |
Please push an update to manage Netbox 2.9. |
Hi There, It has been 3 months since this issue is present. Netbox community 2.10 beta is out and we're still stuck with 2.8. Could you please make a choice to let things move on ? If you don't have free time to work on the project, at least take a decision or let people know what should be done further to make it merged. People not updating their Netbox instance probably don't update their cli SDKs as well. Specifying it could be an issue for deployment outdated can be good enough ? |
Is a change like this acceptable ?
I would take extra time to review the _diff() method as it sees a change when there's not for now. Please take some minute to give an insight to this change so I can follow on with the diff (and deduplication if still wished). I'll therefore do a PR. Greetings. |
@zachmoody Any comments on this? I (for one) have quite a huge application stack built on |
I'll be the first to admit I haven't been able to put in the time the project's required lately. I do my best to respond to PRs for bugs and breaking changes like this one quickly, but I can't drop everything and fix them when they need work. I mentioned in my first comment that I can't merge this if we discontinue testing the pre-2.9 behavior. The implication there is that we'd need something to handle differentiating them. Your PR (#307) is one way, and I made a comment there mentioning what I'd like to do and when. I probably could've been more clear, sooner.
That's probably not a bet I'd take 😄. I don't really want to get into the game of mapping pynetbox versions to supported versions of NetBox. |
Thanks for the PR, this should be fixed in #311. |
Since Netbox 2.9 tags are returned as nested records instead of just flat strings.
This PR updates pynetbox to correctly handle this new situation.
AFICT this should be backwards compatible.