Skip to content

Commit

Permalink
[sonic-yang-models]: Add default values in leaf-lists of ports in son… (
Browse files Browse the repository at this point in the history
#77)

* [sonic-yang-models]: Add default values in leaf-lists of ports in sonic-acl and sonic-portchannel.

Changes:
-- Add default values in leaf-lists of ports in sonic-acl
-- Add default values in leaf-lists of ports in sonic-portchannel
-- Remove members from sonic-vlan VLAN table. Note this will force Network Operations
   team to change the config.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com

* [src/sonic-utilities]: Updating submodule src/sonic-utilities.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
  • Loading branch information
Praveen Chaudhary authored Jun 12, 2020
1 parent b3793d0 commit f535f5e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
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

0 comments on commit f535f5e

Please sign in to comment.