-
Notifications
You must be signed in to change notification settings - Fork 254
Convert more keys/attribute values from list to set #1487
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
base: devel
Are you sure you want to change the base?
Conversation
841fb81 to
188f97a
Compare
|
I think there's some overlap here with #1456 |
|
The sanity failures are unrelated to your patch. I think a new version of ansible's sanity test checker was released and they've been increasing the strictness. Let me investigate and see if there's an easy fix
|
|
Please rebase this on the latest commits to |
188f97a to
0d181fd
Compare
|
@sc68cal thank you for looking into it. Rebase is done and pushed, but now I'm a bit more confused. After looking into the other merge request you mentioned, they're doing basically the same, but in the Now we've 3 positions where list-set conversions are beeing processed:
Which approach should be the best? I've the feeling that it should be some kind of attribute/parameter to the common functions. So every endpoint module can define their list of attributes that should be considered a set. |
0d181fd to
3335df2
Compare
3335df2 to
f44e434
Compare
|
@sc68cal I've renamed the title and reworked my patch a bit. I partly reverted the previous commit in netbox_users and moved the conversion to utils. There are more modules that make use of object_classes attributes etc. I have to do some more testing, but basically this could up for discussions. I've added a some additional fields that probably should be compared as set (like tagged_vlans, etc) I'm not exactly sure which attributes are considered a set, but I took a conservative approach. Maybe we should check them with multiple eyes. Things to check: config_context: (teants, sites, clusters, etcs.) |
|
@dchiquito Maybe you can give me your thoughts as well, as it effects your previous commit as well. |
|
@dhoffend If you have PR to |
|
I was only aware of the fields in the contact module when I made my changes, which is why I changed However, the best solution would be to upstream the fix |
|
I guess there are more set attributes in the config_context sections (where the config contexts should be applied to). I just hadn't yet the time to test things out. Sure a bigger list of endpoints and attributes (which should be considered a set) in the underlaying |
|
Hmmmm looking at pynetbox code: This doesn't look like a real |
Related Issue
Fixes #1486
New Behavior
In addition to
tags, the fieldstagged_vlansandobject_typesshould be considered a set, not an ordered list. This should be in sync withpynetboxas well. (https://github.com/netbox-community/pynetbox/blob/master/pynetbox/core/response.py#L25-L26) I'll propose that object_types will be added there as well.This is a follow up on #1456 to take a more generic approach when lists should be converted to/compared as set
...
Contrast to Current Behavior
The field
object_typesis currently handled as a sorted list, but the response is unsorted resuting in constand changed tasks, even nothing has changed....
Discussion: Benefits and Drawbacks
I don't see any drawbacks as object_types is not considered to be ordered.
...
Changes to the Documentation
Nothing, as it doesn't affect the outcome, it just fixes a display issue (changed vs ok)
Proposed Release Note Entry
Take a more generic approach for set comparison. Other models have object_types too
...
Double Check
develbranch.