Skip to content

Commit

Permalink
Modify psu-fan to read PSU presence sysfs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jostar Yang committed Mar 1, 2022
1 parent 8981c0d commit 243ace8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions device/accton/x86_64-accton_as9716_32d-r0/sonic_platform/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,20 @@ def get_presence(self):
Returns:
bool: True if FAN is present, False if not
"""
present_path = "{}{}{}".format(CPLD_FAN_I2C_PATH, self.fan_tray_index+1, '_present')
val=self._api_helper.read_txt_file(present_path)
if not self.is_psu_fan:
present_path = "{}{}{}".format(CPLD_FAN_I2C_PATH, self.fan_tray_index+1, '_present')
val=self._api_helper.read_txt_file(present_path)
if val is not None:
return int(val, 10)==1
else:
return False
else:
return True
present_path= "{}{}".format(self.psu_cpld_path, 'psu_present')
val=self._api_helper.read_txt_file(present_path)
if val is not None:
return int(val, 10)==1
else:
return False

def get_status(self):
"""
Expand Down

0 comments on commit 243ace8

Please sign in to comment.