diff --git a/platform/broadcom/sonic-platform-modules-inventec/common/utils/asic_monitor.py b/platform/broadcom/sonic-platform-modules-inventec/common/utils/asic_monitor.py index 622bdb84da09..9c994c572dd4 100755 --- a/platform/broadcom/sonic-platform-modules-inventec/common/utils/asic_monitor.py +++ b/platform/broadcom/sonic-platform-modules-inventec/common/utils/asic_monitor.py @@ -64,7 +64,7 @@ class BCMUtil(bcmshell): def get_platform(self): if self.platform is None: - _, self.platform = getstatusoutput_noshell(["uname", "-n"]) + _, self.platform = getstatusoutput_noshell(["uname", "-n"]).strip() return self.platform def get_asic_temperature( self ): diff --git a/platform/broadcom/sonic-platform-modules-inventec/common/utils/platform_status.py b/platform/broadcom/sonic-platform-modules-inventec/common/utils/platform_status.py index 3c547b2fe036..d73687e025ae 100755 --- a/platform/broadcom/sonic-platform-modules-inventec/common/utils/platform_status.py +++ b/platform/broadcom/sonic-platform-modules-inventec/common/utils/platform_status.py @@ -60,6 +60,6 @@ def next_events(self): # Receive thermaltrip event if event['ACTION'] == 'remove' and event['DEVPATH'] == '/kernel/platform_status/fan': - subprocess.run(["shutdown", "-h", "now"]) + subprocess.call(["shutdown", "-h", "now"]) diff --git a/platform/broadcom/sonic-platform-modules-inventec/d6332/sonic_platform/qsfp.py b/platform/broadcom/sonic-platform-modules-inventec/d6332/sonic_platform/qsfp.py index f9e3edc888c5..f71a19d00e62 100644 --- a/platform/broadcom/sonic-platform-modules-inventec/d6332/sonic_platform/qsfp.py +++ b/platform/broadcom/sonic-platform-modules-inventec/d6332/sonic_platform/qsfp.py @@ -121,7 +121,7 @@ def __set_attr_value(self, attr_path, value): return True def __is_host(self): - return subprocess.run(["docker"]).returncode == 0 + return subprocess.call(["docker"]) == 0 def __get_path_to_port_config_file(self): host_platform_root_path = '/usr/share/sonic/device' diff --git a/platform/broadcom/sonic-platform-modules-inventec/d6332/utils/inventec_d6332_util.py b/platform/broadcom/sonic-platform-modules-inventec/d6332/utils/inventec_d6332_util.py index 0cee9dc382bf..d467fd8fb5df 100755 --- a/platform/broadcom/sonic-platform-modules-inventec/d6332/utils/inventec_d6332_util.py +++ b/platform/broadcom/sonic-platform-modules-inventec/d6332/utils/inventec_d6332_util.py @@ -238,7 +238,7 @@ def system_install(boot_option): for addr_offset in range (0,FAN_NUM): addr=FAN_VPD_ADDR_BASE+addr_offset cmd1 = ["i2cdetect", "-y", str(FAN_VPD_CHANNEL), str(addr), str(addr)] - cmd2 = ["grep", str(hex(addr)).replace('0x','')] + cmd2 = ["grep", f'{addr:x}'] result, _ = getstatusoutput_noshell_pipe(cmd1, cmd2) if( result==0 ): cmd="echo inv_eeprom "+str(addr)+" > /sys/bus/i2c/devices/i2c-"+FAN_VPD_CHANNEL diff --git a/platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/qsfp.py b/platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/qsfp.py index d4144a66006f..22eae317f8ce 100644 --- a/platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/qsfp.py +++ b/platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/qsfp.py @@ -109,7 +109,7 @@ def __get_attr_value(self, attr_path): return retval def __is_host(self): - return subprocess.run(["docker"]).returncode == 0 + return subprocess.call(["docker"]) == 0 def __get_path_to_port_config_file(self): host_platform_root_path = '/usr/share/sonic/device' diff --git a/platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/sfp.py index ff0539e3abc0..de8d50b7abda 100644 --- a/platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/sfp.py @@ -95,7 +95,7 @@ def __get_attr_value(self, attr_path): return retval def __is_host(self): - return subprocess.run(["docker"]).returncode == 0 + return subprocess.call(["docker"]) == 0 def __get_path_to_port_config_file(self): host_platform_root_path = '/usr/share/sonic/device' diff --git a/platform/broadcom/sonic-platform-modules-inventec/d7054q28b/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-inventec/d7054q28b/sonic_platform/sfp.py index 687ff0329ea3..ee5768a640f7 100644 --- a/platform/broadcom/sonic-platform-modules-inventec/d7054q28b/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-inventec/d7054q28b/sonic_platform/sfp.py @@ -285,7 +285,7 @@ def __read_txt_file(self, file_path): return "" def __is_host(self): - return subprocess.run(self.HOST_CHK_CMD).returncode == 0 + return subprocess.call(self.HOST_CHK_CMD) == 0 def __get_path_to_port_config_file(self): platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM])