-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schema: return float for decimal64 in default function
This patch changes the output for leaf/leaf-list nodes using decimal64 type, and adds new unit test for this purpose. The leaf-list defaults function is reworked to be similar to the leaf default function. A new yang schema is added for clarity, and to avoid modifying all the tests using yolo-system.yang. Fixes: #80 Signed-off-by: Stefan Gula <[email protected]> Signed-off-by: Samuel Gauthier <[email protected]>
- Loading branch information
1 parent
3b4d509
commit 3428ea0
Showing
3 changed files
with
74 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module yolo-nodetypes { | ||
yang-version 1.1; | ||
namespace "urn:yang:yolo:nodetypes"; | ||
prefix sys; | ||
|
||
description | ||
"YOLO Nodetypes."; | ||
|
||
revision 2024-01-25 { | ||
description | ||
"Initial version."; | ||
} | ||
|
||
container conf { | ||
description | ||
"Configuration."; | ||
leaf percentage { | ||
type decimal64 { | ||
fraction-digits 2; | ||
} | ||
default 10.2; | ||
} | ||
|
||
leaf-list ratios { | ||
type decimal64 { | ||
fraction-digits 2; | ||
} | ||
default 2.5; | ||
default 2.6; | ||
} | ||
} | ||
} |