Description
When adding new mirror session with queue value = 0, it is not entered to the config DB and won't show when printing the current mirror sessions.
The issue is found on master/202111/202012 branches, however it works correctly on 202106 branch.
I explored it a bit and the issue was introduced after PR #1825.
Steps to reproduce the issue:
Run the following commands:
- sudo config mirror_session erspan add ERSPAN2 100.0.0.1 100.0.0.2 0 11 35145 0 Ethernet0 rx
- show mirror_session
Describe the results you received:
Queue value is empty:

Describe the results you expected:
(202106 SONiC build)

Output of show version:

Additional information you deem important (e.g. issue happens only occasionally):

It looks like the issue can be solved by either omitting ‘type=QUEUE_RANGE’ but this way the queue value won't be validated, or keep the validation in place and change the condition check to: ‘if queue >= 0:’.
Both options solve the issue.
Description
When adding new mirror session with queue value = 0, it is not entered to the config DB and won't show when printing the current mirror sessions.
The issue is found on master/202111/202012 branches, however it works correctly on 202106 branch.
I explored it a bit and the issue was introduced after PR #1825.
Steps to reproduce the issue:
Run the following commands:
Describe the results you received:
Queue value is empty:

Describe the results you expected:
(202106 SONiC build)

Output of
show version:Additional information you deem important (e.g. issue happens only occasionally):
It looks like the issue can be solved by either omitting ‘type=QUEUE_RANGE’ but this way the queue value won't be validated, or keep the validation in place and change the condition check to: ‘if queue >= 0:’.
Both options solve the issue.