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
list_obj is of YANGBaseClass type while d[key] is regular list.
When it checks if e isn't in d[key] (third line from bottom) e is ReferencePathType while items in d[key] are regular strings (at least in my case).
So e is never in d[key] and it gets removed.
I fixed my local issue just by casting ReferencePathType to str, but i am not sure if that works in all cases:
diff --git a/pyangbind/lib/serialize.py b/pyangbind/lib/serialize.py
index 1308a4b..8f57ff5 100644
--- a/pyangbind/lib/serialize.py
+++ b/pyangbind/lib/serialize.py
@@ -308,7 +308,7 @@ class pybindJSONDecoder(object):
for elem in list_obj:
list_copy.append(elem)
for e in list_copy:
- if e not in d[key]:
+ if str(e) not in d[key]:
list_obj.remove(e)
set_via_stdmethod = False
else:
Can you take a look?
The text was updated successfully, but these errors were encountered:
Hello,
Running the script below id expect it returns True, but it does not.
Reason is serialize's load_json method TypedListType objects during parsing.
Here's the relevant piece of code:
list_obj is of YANGBaseClass type while d[key] is regular list.
When it checks if e isn't in d[key] (third line from bottom) e is ReferencePathType while items in d[key] are regular strings (at least in my case).
So e is never in d[key] and it gets removed.
I fixed my local issue just by casting ReferencePathType to str, but i am not sure if that works in all cases:
Can you take a look?
The text was updated successfully, but these errors were encountered: