Skip to content

Commit

Permalink
[Edgecore][device][platform] psu-fan direction get N/A when it is pow…
Browse files Browse the repository at this point in the history
…er_good= failed.

Signed-off-by: michael_shih <michael_shih@edge-core.com>
  • Loading branch information
ec-michael-shih committed Dec 8, 2022
1 parent 737aca1 commit cbe5eb1
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,20 @@ def get_direction(self):
direction=self.FAN_DIRECTION_EXHAUST

else: #For PSU
direction=self.FAN_DIRECTION_EXHAUST
psu_path = "{}{}".format(self.psu_cpld_path, 'psu_power_good')
val = self._api_helper.read_txt_file(psu_path)
if val is None or int(val, 10)==0:
return self.FAN_DIRECTION_NOT_APPLICABLE

dir_str = "{}{}".format(self.psu_hwmon_path,'psu_fan_dir')
val=self._api_helper.read_txt_file(dir_str)
if val is None or val == "":
return self.FAN_DIRECTION_EXHAUST
else:
if val=='F2B':
direction=self.FAN_DIRECTION_EXHAUST
else:
direction=self.FAN_DIRECTION_INTAKE

return direction

Expand Down

0 comments on commit cbe5eb1

Please sign in to comment.