[yang] Change swss-event, dhcp-relay-event leafref to string (#13326)
Why I did it Do not require leafref as part of yang. Only need string to compare whether string received from event matches what is possible for ifname. How I did it How to verify it Run UT
This commit is contained in:
parent
4974b5c49c
commit
f239a8388c
@ -1,8 +1,7 @@
|
||||
{
|
||||
"SONIC_EVENTS_DHCP_RELAY_DHCP_RELAY_DISCARD_INCORRECT_IFNAME": {
|
||||
"desc": "DHCP_RELAY_DISCARD_EVENT_INCORRECT_IFNAME failure.",
|
||||
"eStrKey": "InvalidValue",
|
||||
"eStr": ["Eth"]
|
||||
"eStrKey": "Pattern"
|
||||
},
|
||||
"SONIC_EVENTS_DHCP_RELAY_DHCP_RELAY_DISCARD_INCORRECT_TIMESTAMP": {
|
||||
"desc": "DHCP_RELAY_DISCARD_EVENT_INCORRECT_TIMESTAMP failure.",
|
||||
|
@ -1,8 +1,7 @@
|
||||
{
|
||||
"SONIC_EVENTS_SWSS_IF_STATE_INCORRECT_IFNAME": {
|
||||
"desc": "IF_STATE_EVENT_INCORRECT_IFNAME failure.",
|
||||
"eStrKey": "LeafRef",
|
||||
"eStr": ["Eth"]
|
||||
"eStrKey": "Pattern"
|
||||
},
|
||||
"SONIC_EVENTS_SWSS_IF_STATE_INCORRECT_STATUS": {
|
||||
"desc": "IF_STATE_EVENT_INCORRECT_STATUS failure.",
|
||||
@ -17,8 +16,7 @@
|
||||
},
|
||||
"SONIC_EVENTS_SWSS_PFC_STORM_INCORRECT_IFNAME": {
|
||||
"desc": "PFC_STORM_EVENT_INCORRECT_IFNAME failure.",
|
||||
"eStrKey": "LeafRef",
|
||||
"eStr": ["Eth"]
|
||||
"eStrKey": "Pattern"
|
||||
},
|
||||
"SONIC_EVENTS_SWSS_PFC_STORM_INCORRECT_QUEUE_INDEX": {
|
||||
"desc": "PFC_STORM_EVENT_INCORRECT_QUEUE_INDEX failure.",
|
||||
|
@ -1,30 +1,5 @@
|
||||
{
|
||||
"SONIC_EVENTS_DHCP_RELAY_DHCP_RELAY_DISCARD_INCORRECT_IFNAME": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-portchannel:sonic-portchannel": {
|
||||
"sonic-portchannel:PORTCHANNEL": {
|
||||
"PORTCHANNEL_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"name": "PortChannel10"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-dhcp-relay:sonic-events-dhcp-relay": {
|
||||
"sonic-events-dhcp-relay:dhcp-relay-discard": {
|
||||
"ifname": "Eth",
|
||||
@ -33,31 +8,6 @@
|
||||
}
|
||||
},
|
||||
"SONIC_EVENTS_DHCP_RELAY_DHCP_RELAY_DISCARD_INCORRECT_TIMESTAMP": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-portchannel:sonic-portchannel": {
|
||||
"sonic-portchannel:PORTCHANNEL": {
|
||||
"PORTCHANNEL_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"name": "PortChannel10"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-dhcp-relay:sonic-events-dhcp-relay": {
|
||||
"sonic-events-dhcp-relay:dhcp-relay-discard": {
|
||||
"ifname": "Ethernet0",
|
||||
@ -66,31 +16,6 @@
|
||||
}
|
||||
},
|
||||
"SONIC_EVENTS_DHCP_RELAY_DHCP_RELAY_DISCARD_VALID": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-portchannel:sonic-portchannel": {
|
||||
"sonic-portchannel:PORTCHANNEL": {
|
||||
"PORTCHANNEL_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"name": "PortChannel10"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-dhcp-relay:sonic-events-dhcp-relay": {
|
||||
"sonic-events-dhcp-relay:dhcp-relay-discard": {
|
||||
"ifname": "Ethernet0",
|
||||
|
@ -1,20 +1,5 @@
|
||||
{
|
||||
"SONIC_EVENTS_SWSS_IF_STATE_INCORRECT_IFNAME": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-swss:sonic-events-swss": {
|
||||
"sonic-events-swss:if-state": {
|
||||
"ifname": "Eth",
|
||||
@ -24,21 +9,6 @@
|
||||
}
|
||||
},
|
||||
"SONIC_EVENTS_SWSS_IF_STATE_INCORRECT_STATUS": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-swss:sonic-events-swss": {
|
||||
"sonic-events-swss:if-state": {
|
||||
"ifname": "Ethernet0",
|
||||
@ -48,21 +18,6 @@
|
||||
}
|
||||
},
|
||||
"SONIC_EVENTS_SWSS_IF_STATE_INCORRECT_TIMESTAMP": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-swss:sonic-events-swss": {
|
||||
"sonic-events-swss:if-state": {
|
||||
"ifname": "Ethernet0",
|
||||
@ -72,21 +27,6 @@
|
||||
}
|
||||
},
|
||||
"SONIC_EVENTS_SWSS_IF_STATE_VALID": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-swss:sonic-events-swss": {
|
||||
"sonic-events-swss:if-state": {
|
||||
"ifname": "Ethernet0",
|
||||
@ -96,21 +36,6 @@
|
||||
}
|
||||
},
|
||||
"SONIC_EVENTS_SWSS_PFC_STORM_INCORRECT_IFNAME": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-swss:sonic-events-swss": {
|
||||
"sonic-events-swss:pfc-storm": {
|
||||
"ifname": "Eth",
|
||||
@ -122,21 +47,6 @@
|
||||
}
|
||||
},
|
||||
"SONIC_EVENTS_SWSS_PFC_STORM_INCORRECT_QUEUE_INDEX": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-swss:sonic-events-swss": {
|
||||
"sonic-events-swss:pfc-storm": {
|
||||
"ifname": "Ethernet0",
|
||||
@ -148,21 +58,6 @@
|
||||
}
|
||||
},
|
||||
"SONIC_EVENTS_SWSS_PFC_STORM_INCORRECT_QUEUE_ID": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-swss:sonic-events-swss": {
|
||||
"sonic-events-swss:pfc-storm": {
|
||||
"ifname": "Ethernet0",
|
||||
@ -174,21 +69,6 @@
|
||||
}
|
||||
},
|
||||
"SONIC_EVENTS_SWSS_PFC_STORM_INCORRECT_PORT_ID": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-swss:sonic-events-swss": {
|
||||
"sonic-events-swss:pfc-storm": {
|
||||
"ifname": "Ethernet0",
|
||||
@ -200,21 +80,6 @@
|
||||
}
|
||||
},
|
||||
"SONIC_EVENTS_SWSS_PFC_STORM_INCORRECT_TIMESTAMP": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-swss:sonic-events-swss": {
|
||||
"sonic-events-swss:pfc-storm": {
|
||||
"ifname": "Ethernet0",
|
||||
@ -226,21 +91,6 @@
|
||||
}
|
||||
},
|
||||
"SONIC_EVENTS_SWSS_PFC_STORM_VALID": {
|
||||
"sonic-port:sonic-port": {
|
||||
"sonic-port:PORT": {
|
||||
"PORT_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "eth0",
|
||||
"description": "Ethernet0",
|
||||
"lanes": 65,
|
||||
"mtu": 9000,
|
||||
"name": "Ethernet0",
|
||||
"speed": 25000
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sonic-events-swss:sonic-events-swss": {
|
||||
"sonic-events-swss:pfc-storm": {
|
||||
"ifname": "Ethernet0",
|
||||
|
@ -40,16 +40,11 @@ module sonic-events-dhcp-relay {
|
||||
name of the interface discarding.";
|
||||
|
||||
leaf ifname {
|
||||
type union {
|
||||
type leafref {
|
||||
path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name";
|
||||
}
|
||||
type leafref {
|
||||
path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name";
|
||||
}
|
||||
type string {
|
||||
pattern 'Ethernet[0-9]{1,3}';
|
||||
}
|
||||
description "Name of the i/f discarding";
|
||||
}
|
||||
}
|
||||
|
||||
uses evtcmn:sonic-events-cmn;
|
||||
}
|
||||
|
@ -38,11 +38,11 @@ module sonic-events-swss {
|
||||
The name of the flapping i/f and status are the only params.";
|
||||
|
||||
leaf ifname {
|
||||
type leafref {
|
||||
path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name";
|
||||
type string {
|
||||
pattern 'Ethernet[0-9]{1,3}';
|
||||
}
|
||||
description "Interface name";
|
||||
}
|
||||
}
|
||||
|
||||
leaf status {
|
||||
type stypes:admin_status;
|
||||
@ -60,8 +60,8 @@ module sonic-events-swss {
|
||||
The name of the i/f facing the storm is the only param.";
|
||||
|
||||
leaf ifname {
|
||||
type leafref {
|
||||
path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name";
|
||||
type string {
|
||||
pattern 'Ethernet[0-9]{1,2}';
|
||||
}
|
||||
description "Interface name";
|
||||
}
|
||||
|
Reference in New Issue
Block a user