From c1aa648d18463e9a6799ee76ac655045aab4a9b2 Mon Sep 17 00:00:00 2001 From: Praveen Chaudhary Date: Thu, 11 Jun 2020 08:52:17 -0700 Subject: [PATCH 1/2] [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-yang-models/yang-models/sonic-acl.yang | 10 +++++++++- .../yang-models/sonic-portchannel.yang | 14 ++++++++++++-- src/sonic-yang-models/yang-models/sonic-vlan.yang | 8 -------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/sonic-yang-models/yang-models/sonic-acl.yang b/src/sonic-yang-models/yang-models/sonic-acl.yang index 37b16ef0a003..a0155e69e417 100644 --- a/src/sonic-yang-models/yang-models/sonic-acl.yang +++ b/src/sonic-yang-models/yang-models/sonic-acl.yang @@ -267,7 +267,7 @@ 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; @@ -275,7 +275,15 @@ module sonic-acl { 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 */ diff --git a/src/sonic-yang-models/yang-models/sonic-portchannel.yang b/src/sonic-yang-models/yang-models/sonic-portchannel.yang index a9bc5dc3b1bf..bf342b9fcfec 100644 --- a/src/sonic-yang-models/yang-models/sonic-portchannel.yang +++ b/src/sonic-yang-models/yang-models/sonic-portchannel.yang @@ -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 { diff --git a/src/sonic-yang-models/yang-models/sonic-vlan.yang b/src/sonic-yang-models/yang-models/sonic-vlan.yang index d345241c6f74..cba7ce1d0f8e 100644 --- a/src/sonic-yang-models/yang-models/sonic-vlan.yang +++ b/src/sonic-yang-models/yang-models/sonic-vlan.yang @@ -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 */ } From ac9156e3224cbad8dde8a1971ec1a5f6a4aca586 Mon Sep 17 00:00:00 2001 From: Praveen Chaudhary Date: Thu, 11 Jun 2020 17:06:16 -0700 Subject: [PATCH 2/2] [src/sonic-utilities]: Updating submodule src/sonic-utilities. Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 3490d3ac19e8..3d9be4574838 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 3490d3ac19e8a71a0b535fd77cfe635a569d89fc +Subproject commit 3d9be4574838647d442c6e1205e424051b78c1f6