From 76ae431e41dca1255f8056b590668c9ca187f031 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Thu, 21 Jun 2018 17:52:12 -0700 Subject: [PATCH] [sfputilbase.py] Fix bug where 'title' list always gets overwritten with empty list (#8) --- sonic_sfp/sfputilbase.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sonic_sfp/sfputilbase.py b/sonic_sfp/sfputilbase.py index efbd248c53..cea924906e 100644 --- a/sonic_sfp/sfputilbase.py +++ b/sonic_sfp/sfputilbase.py @@ -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