Skip to content

Commit bff1462

Browse files
Bill Stephensrjarry
authored andcommitted
data: fix merge operation
lyd_merge_* functions may modify the passed dnode pointer. Make sure to update the self.cdata pointer after the operation. Fixes: #49 Signed-off-by: Bill Stephens <william.stephens@megaport.com>
1 parent ef885cc commit bff1462

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libyang/data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,8 @@ def merge(
552552
if ret != lib.LY_SUCCESS:
553553
raise self.context.error("merge failed")
554554

555+
self.cdata = node_p[0]
556+
555557
def iter_tree(self) -> Iterator["DNode"]:
556558
n = next_n = self.cdata
557559
while n != ffi.NULL:

0 commit comments

Comments
 (0)