Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sonic-yang-models]: Add default values in leaf-lists of ports in son… #77

Merged
merged 2 commits into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sonic-utilities
10 changes: 9 additions & 1 deletion src/sonic-yang-models/yang-models/sonic-acl.yang
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,23 @@ module sonic-acl {
}

leaf-list ports {
/* union of leafref is allowed in YANG 1.1 */
/* union of leafref is allowed in YANG 1.1 */
type union {
type leafref {
path /port:sonic-port/port:PORT/port:PORT_LIST/port:port_name;
}
type leafref {
path /lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:portchannel_name;
}
type string {
pattern "";
}
}
/* Today in SONiC, we do not delete the list once
* created, instead we set to empty list. Due to that
* below default values are needed.
*/
default "";
}
}
/* end of ACL_TABLE_LIST */
Expand Down
14 changes: 12 additions & 2 deletions src/sonic-yang-models/yang-models/sonic-portchannel.yang
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,19 @@ module sonic-portchannel {

leaf-list members {
/* leaf-list members are unique by default */
type leafref {
path /port:sonic-port/port:PORT/port:PORT_LIST/port:port_name;
type union {
type leafref {
path /port:sonic-port/port:PORT/port:PORT_LIST/port:port_name;
}
type string {
pattern "";
}
}
/* Today in SONiC, we do not delete the list once
* created, instead we set to empty list. Due to that
* below default values are needed.
*/
default "";
}

leaf min_links {
Expand Down
8 changes: 0 additions & 8 deletions src/sonic-yang-models/yang-models/sonic-vlan.yang
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,6 @@ module sonic-vlan {
leaf admin_status {
type head:admin_status;
}

leaf-list members {
/* leaf-list members are unique by default */

type leafref {
path "/port:sonic-port/port:PORT/port:PORT_LIST/port:port_name";
}
}
}
/* end of VLAN_LIST */
}
Expand Down