From 243ace8882dd13c5f2ee17462d7d7031eeb5b6f1 Mon Sep 17 00:00:00 2001 From: Jostar Yang Date: Tue, 1 Mar 2022 16:43:49 +0800 Subject: [PATCH] Modify psu-fan to read PSU presence sysfs --- .../x86_64-accton_as9716_32d-r0/sonic_platform/fan.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/device/accton/x86_64-accton_as9716_32d-r0/sonic_platform/fan.py b/device/accton/x86_64-accton_as9716_32d-r0/sonic_platform/fan.py index 491f00ead7d4..4d31a9695440 100644 --- a/device/accton/x86_64-accton_as9716_32d-r0/sonic_platform/fan.py +++ b/device/accton/x86_64-accton_as9716_32d-r0/sonic_platform/fan.py @@ -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): """