Skip to content

Commit 93589c7

Browse files
[pretest] update collect_dut_lossless_prio method (#17907)
Fix method collect_dut_lossless_prio. The pfc_enable parameter can be empty. Without this change we can get error: > result = [int(x) for x in port_qos_map[intf]['pfc_enable'].split(',')] E ValueError: invalid literal for int() with base 10: '' PRs with related changes: sonic-net/sonic-buildimage#22252 sonic-net/sonic-buildimage#22067 Signed-off-by: AntonHryshchuk <[email protected]>
1 parent 3d6e1b6 commit 93589c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_pretest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def collect_dut_lossless_prio(dut):
226226

227227
""" Here we assume all the ports have the same lossless priorities """
228228
intf = list(port_qos_map.keys())[0]
229-
if 'pfc_enable' not in port_qos_map[intf]:
229+
if not port_qos_map[intf].get('pfc_enable'):
230230
return []
231231

232232
result = [int(x) for x in port_qos_map[intf]['pfc_enable'].split(',')]

0 commit comments

Comments
 (0)