Skip to content

Commit 3b4d509

Browse files
schema: fix leaf-list defaults
Instanciate a Type module to be able to compare with Type enum. The next commit will add unit tests. Fixes: 806be4c ("Port to libyang 2") Fixes: CESNET#80 Signed-off-by: Stefan Gula <steweg@gmail.com> Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind.com>
1 parent cccb9d6 commit 3b4d509

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
@@ -1279,7 +1279,7 @@ def defaults(self) -> Iterator[str]:
12791279
if not val:
12801280
yield None
12811281
ret = c2str(val)
1282-
val_type = self.cdata_leaflist.dflts[i].realtype
1282+
val_type = Type(self.context, self.cdata_leaflist.dflts[i].realtype, None)
12831283
if val_type == Type.BOOL:
12841284
ret = val == "true"
12851285
elif val_type in Type.NUM_TYPES:

0 commit comments

Comments
 (0)