Skip to content

Commit

Permalink
[sfputilbase.py] Fix bug where 'title' list always gets overwritten w…
Browse files Browse the repository at this point in the history
…ith empty list (sonic-net#8)
  • Loading branch information
jleveque authored Jun 22, 2018
1 parent 9adb75f commit 76ae431
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sonic_sfp/sfputilbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,15 @@ def read_porttab_mappings(self, porttabfile):

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

Expand Down

0 comments on commit 76ae431

Please sign in to comment.