Skip to content

Commit

Permalink
Fix PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: maipbui <maibui@microsoft.com>
  • Loading branch information
maipbui committed Oct 5, 2022
1 parent 409c027 commit 799902a
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"])


Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 799902a

Please sign in to comment.