Skip to content

Commit 40a0eb1

Browse files
Fix IndexError when parsing FIB route keys without colon
Signed-off-by: nnelluri-cisco <[email protected]>
1 parent 463ac4c commit 40a0eb1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/common/fixtures/fib_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,11 @@ def get_fib_info(duthost, dut_cfg_facts, duts_mg_facts, testname=None):
213213
fib = json.load(fp)
214214
for k, v in list(fib.items()):
215215
skip = False
216-
217-
prefix = k.split(':', 1)[1]
216+
if ":" in k:
217+
prefix = k.split(':', 1)[1]
218+
else:
219+
# Handle keys without colon
220+
continue
218221
ifnames = v['value']['ifname'].split(',')
219222
nh = v['value']['nexthop']
220223

0 commit comments

Comments
 (0)