You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found out that any version over 7.0.0, essentially anything containing the #518 fix that rewrote flatten_custom, is breaking updating this custom_field via pynetbox. update() returns fine, but all dicts are set as None into netbox.
The issue seems to lie with a cornercase in flatten_custom.
Below you can find a way to test this with 7.0.0, 7.2.0 and a candidate fix that I'll open a PR with.
Thanks!
to run it, just execute ./run.sh, after writing adding these two files into some directory.
@abhi1693@arthanson Any chance of a merge or a comment here? I just lost a few hours of debugging eventually figuring out that pynetbox simply wasn't doing what I was asking it to do. It's specifically impactful for custom fields of type JSON.
pynetbox version
v7.2.0
NetBox version
v3.5.9
Python version
3.11
Steps to Reproduce
Hello,
in our setup we introduced a complex custom_field in each device that is of the following form, in python notation:
I found out that any version over 7.0.0, essentially anything containing the #518 fix that rewrote
flatten_custom
, is breaking updating this custom_field via pynetbox.update()
returns fine, but all dicts are set asNone
into netbox.The issue seems to lie with a cornercase in
flatten_custom
.Below you can find a way to test this with 7.0.0, 7.2.0 and a candidate fix that I'll open a PR with.
Thanks!
to run it, just execute
./run.sh
, after writing adding these two files into some directory.filename: run.sh
filename: test_custom_fields.py
Expected Behavior
Netbox should contain the structure we push.
ie. for:
we should get the same back, either by browsing netbox or querying the relevant custom_field through pynetbox
Observed Behavior
Instead, the following gets stored into netbox and gets retrieved:
The text was updated successfully, but these errors were encountered: