forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yang-models]: Add yang extension to control traslation configDB<->ya…
…ng from YANG models. (#52) Changes: 1.) Added yang extensions in YANG models. 2.) Changed the translation and rev translation code to depend on yang extensions. 3.) Load yang models in test code similar to dev code. 4.) Minor changes in test files. Signed-off-by: Praveen Chaudhary [email protected]
- Loading branch information
Praveen Chaudhary
authored
Mar 17, 2020
1 parent
2cf860b
commit a65c1f3
Showing
11 changed files
with
142 additions
and
64 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
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
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 |
---|---|---|
|
@@ -12,6 +12,11 @@ module sonic-loopback-interface { | |
revision-date 2019-07-01; | ||
} | ||
|
||
import sonic-extension { | ||
prefix ext; | ||
revision-date 2019-07-01; | ||
} | ||
|
||
organization "Linkedin Corporation"; | ||
|
||
contact "[email protected]"; | ||
|
@@ -30,6 +35,10 @@ module sonic-loopback-interface { | |
list LOOPBACK_INTERFACE_LIST { | ||
key "loopback_interface_name"; | ||
|
||
ext:key-regex-configdb-to-yang "^([a-zA-Z0-9-_]+)$"; | ||
|
||
ext:key-regex-yang-to-configdb "<loopback_interface_name>"; | ||
|
||
leaf loopback_interface_name{ | ||
type string; | ||
} | ||
|
@@ -47,8 +56,11 @@ module sonic-loopback-interface { | |
|
||
key "loopback_interface_name ip-prefix"; | ||
|
||
leaf loopback_interface_name{ | ||
ext:key-regex-configdb-to-yang "^([a-zA-Z0-9-_]+)|([a-fA-F0-9:./]+$)"; | ||
|
||
ext:key-regex-yang-to-configdb "<loopback_interface_name>|<ip-prefix>"; | ||
|
||
leaf loopback_interface_name{ | ||
/* This node must be present in LOOPBACK_INTERFACE_LIST */ | ||
must "(current() = ../../LOOPBACK_INTERFACE_LIST[loopback_interface_name=current()]/loopback_interface_name)" | ||
{ | ||
|
Oops, something went wrong.