Skip to content

Commit 5dbce04

Browse files
committed
schema: remove error after lyd_value_validate_dflt call
libyang returns the realtype field when the store callback return code is LY_SUCCESS and LY_EINCOMPLETE. Don't raise an error when lyd_value_validate_dflt returns LY_EINCOMPLETE. The function can then use the val_type_cdata field. Link: https://github.com/CESNET/libyang/blob/master/src/tree_data_common.c#L682 Signed-off-by: Jeremie Leska <[email protected]>
1 parent 0a4b09f commit 5dbce04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libyang/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@ def default(self) -> Union[None, bool, int, str, float]:
15451545
val_type_cdata,
15461546
ffi.NULL,
15471547
)
1548-
if ret != lib.LY_SUCCESS:
1548+
if ret not in (lib.LY_SUCCESS, lib.LY_EINCOMPLETE):
15491549
raise self.context.error("Unable to get real type of default value")
15501550
self.cdata_default_realtype = Type(self.context, val_type_cdata[0], None)
15511551

0 commit comments

Comments
 (0)