Skip to content

Commit 7b9f7b6

Browse files
Fixed logic to delete the interface from BUFFER_QUEUE (#16687)
Description of PR The interface from where the queuestats fetched was different from the interface that was deleted from the BUFFER_QUEUE. Github issue: aristanetworks/sonic-qual.msft#371 This issue is seen after PR: #15688 The issue was that XML dump is below for context buffer_queue_to_del = 'Ethernet112|6' buffer_queues = ['Ethernet112|0-1', 'Ethernet112|2-4', 'Ethernet112|5', 'Ethernet112|6', 'Ethernet112|7', 'Ethernet116|0-1', ...] buffer_queues_removed = 1 interface = 'Ethernet68' When the string 'Ethernet112|6' when split with delimiter "|" the string in 1st index "6" is a substring of "Ethernet68" and it picked as a candidate to delete it from BQ, which is wrong. Summary: Fixes # aristanetworks/sonic-qual.msft#371
1 parent 63fdab8 commit 7b9f7b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/snmp/test_snmp_queue_counters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_snmp_queue_counters(duthosts,
126126

127127
# Get appropriate buffer queue value to delete
128128
buffer_queues = list(data['BUFFER_QUEUE'].keys())
129-
iface_buffer_queues = [bq for bq in buffer_queues if any(val in interface for val in bq.split('|'))]
129+
iface_buffer_queues = [bq for bq in buffer_queues if bq.split('|')[0] == interface]
130130
if iface_buffer_queues:
131131
buffer_queue_to_del = iface_buffer_queues[0]
132132
else:

0 commit comments

Comments
 (0)