Skip to content

Commit 76ae431

Browse files
authored
[sfputilbase.py] Fix bug where 'title' list always gets overwritten with empty list (sonic-net#8)
1 parent 9adb75f commit 76ae431

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sonic_sfp/sfputilbase.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,15 @@ def read_porttab_mappings(self, porttabfile):
268268

269269
# Read the porttab file and generate dicts
270270
# with mapping for future reference.
271-
# XXX: move the porttab
272-
# parsing stuff to a separate module, or reuse
273-
# if something already exists
271+
#
272+
# TODO: Refactor this to use the portconfig.py module that now
273+
# exists as part of the sonic-config-engine package.
274+
title = []
274275
for line in f:
275276
line.strip()
276-
title = []
277277
if re.search("^#", line) is not None:
278278
# The current format is: # name lanes alias index speed
279+
# Where the ordering of the columns can vary
279280
title = line.split()[1:]
280281
continue
281282

0 commit comments

Comments
 (0)