Skip to content

Commit c29dc57

Browse files
committed
data: add missing raise statement
Without this, no error is risen to the caller. Fixes: 49fd8ea ("Add data tree support") Signed-off-by: Robin Jarry <robin@jarry.cc>
1 parent 35ac0c1 commit c29dc57

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

libyang/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def validate(self, data=False, config=False, get=False, rpc=False,
178178
node_p[0] = self._node
179179
ret = lib.lyd_validate(node_p, flags, ffi.NULL)
180180
if ret != 0:
181-
self.context.error('validation failed')
181+
raise self.context.error('validation failed')
182182

183183
def merge(self, source, destruct=False, no_siblings=False, explicit=False):
184184
flags = parser_flags(destruct=destruct, no_siblings=no_siblings,

tests/test_data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ def test_data_from_dict_leaf(self):
348348
def test_data_from_dict_rpc(self):
349349
dnode = self.ctx.create_data_path('/yolo-system:format-disk')
350350
self.assertIsInstance(dnode, DRpc)
351-
dnode.merge_data_dict({'duration': 42}, rpcreply=True, strict=True)
351+
dnode.merge_data_dict(
352+
{'duration': 42}, rpcreply=True, strict=True, no_yanglib=True)
352353
try:
353354
j = dnode.print_mem('json')
354355
finally:

0 commit comments

Comments
 (0)