Skip to content

Commit 0042993

Browse files
Fix IndexError when parsing FIB route keys without colon
1 parent 7a3bf3a commit 0042993

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/common/fixtures/fib_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,11 @@ def get_fib_info(duthost, dut_cfg_facts, duts_mg_facts, testname=None):
210210
fib = json.load(fp)
211211
for k, v in list(fib.items()):
212212
skip = False
213-
214-
prefix = k.split(':', 1)[1]
213+
if ":" in k:
214+
prefix = k.split(':', 1)[1]
215+
else:
216+
# Handle keys without colon
217+
continue
215218
ifnames = v['value']['ifname'].split(',')
216219
nh = v['value']['nexthop']
217220

0 commit comments

Comments
 (0)