@@ -58,7 +58,8 @@ def path_flags(update=False, rpc_output=False, no_parent_ret=False):
58
58
59
59
#------------------------------------------------------------------------------
60
60
def parser_flags (data = False , config = False , get = False , strict = False ,
61
- trusted = False , no_yanglib = False , rpc = False ):
61
+ trusted = False , no_yanglib = False , rpc = False , destruct = False ,
62
+ no_siblings = False , explicit = False ):
62
63
flags = 0
63
64
if data :
64
65
flags |= lib .LYD_OPT_DATA
@@ -74,6 +75,12 @@ def parser_flags(data=False, config=False, get=False, strict=False,
74
75
flags |= lib .LYD_OPT_DATA_NO_YANGLIB
75
76
if rpc :
76
77
flags |= lib .LYD_OPT_RPC
78
+ if destruct :
79
+ flags |= lib .LYD_OPT_DESTRUCT
80
+ if no_siblings :
81
+ flags |= lib .LYD_OPT_NOSIBLINGS
82
+ if explicit :
83
+ flags |= lib .LYD_OPT_EXPLICIT
77
84
return flags
78
85
79
86
@@ -165,6 +172,13 @@ def validate(self, data=False, config=False, get=False, strict=False,
165
172
if ret != 0 :
166
173
self .context .error ('validation failed' )
167
174
175
+ def merge (self , source , destruct = False , no_siblings = False , explicit = False ):
176
+ flags = parser_flags (destruct = destruct , no_siblings = no_siblings ,
177
+ explicit = explicit )
178
+ ret = lib .lyd_merge (self ._node , source ._node , flags )
179
+ if ret != 0 :
180
+ raise self .context .error ('merge failed' )
181
+
168
182
def print_mem (self , fmt ,
169
183
with_siblings = False ,
170
184
pretty = False ,
0 commit comments