From 26bc0b87a01940b0f5a40be627a067253a86f406 Mon Sep 17 00:00:00 2001 From: Sangita Maity Date: Tue, 3 Mar 2020 12:02:58 -0800 Subject: [PATCH] fix bugs (#3) Signed-off-by: Sangita Maity --- sonic_platform_base/sonic_sfp/sfputilbase.py | 6 +++--- sonic_platform_base/sonic_sfp/sfputilhelper.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sonic_platform_base/sonic_sfp/sfputilbase.py b/sonic_platform_base/sonic_sfp/sfputilbase.py index 015bcefb3..0586d0340 100644 --- a/sonic_platform_base/sonic_sfp/sfputilbase.py +++ b/sonic_platform_base/sonic_sfp/sfputilbase.py @@ -21,7 +21,7 @@ from collections import OrderedDict from natsort import natsorted from sonic_daemon_base.daemon_base import DaemonBase - + import sys except ImportError as e: raise ImportError("%s - required module not found" % str(e)) @@ -383,7 +383,7 @@ def read_porttab_mappings(self, porttabfile): parse_fmt_port_config_ini = (os.path.basename(porttabfile) == PORT_CONFIG_INI) parse_fmt_platform_json = (os.path.basename(porttabfile) == PLATFORM_JSON) - (platform, hwsku) = DaemonBase.get_platform_and_hwsku() + (platform, hwsku) = DaemonBase().get_platform_and_hwsku() if(parse_fmt_platform_json): ports, _ = get_port_config(hwsku, platform) if not ports: @@ -423,7 +423,7 @@ def read_porttab_mappings(self, porttabfile): print("logical to physical: {}".format(self.logical_to_physical)) print("physical to logical: {}".format( self.physical_to_logical)) """ - sys.exit(0) + return None try: diff --git a/sonic_platform_base/sonic_sfp/sfputilhelper.py b/sonic_platform_base/sonic_sfp/sfputilhelper.py index 7102c88c5..cc9dc3afa 100644 --- a/sonic_platform_base/sonic_sfp/sfputilhelper.py +++ b/sonic_platform_base/sonic_sfp/sfputilhelper.py @@ -14,7 +14,7 @@ from collections import OrderedDict from natsort import natsorted from sonic_daemon_base.daemon_base import DaemonBase - + import sys except ImportError as e: raise ImportError("%s - required module not found" % str(e)) @@ -55,7 +55,7 @@ def read_porttab_mappings(self, porttabfile): parse_fmt_port_config_ini = (os.path.basename(porttabfile) == PORT_CONFIG_INI) parse_fmt_platform_json = (os.path.basename(porttabfile) == PLATFORM_JSON) - (platform, hwsku) = DaemonBase.get_platform_and_hwsku() + (platform, hwsku) = DaemonBase().get_platform_and_hwsku() if(parse_fmt_platform_json): ports, _ = get_port_config(hwsku, platform) if not ports: @@ -92,7 +92,7 @@ def read_porttab_mappings(self, porttabfile): print("logical to physical: {}".format(self.logical_to_physical)) print("physical to logical: {}".format( self.physical_to_logical)) """ - sys.exit(0) + return None try: