Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pddf]: Adding support for fan_drawer class in PDDF common platform A…
…PIs (sonic-net#10213) Why I did it fan_drawer support was missing in PDDF common platform APIs. This resulted in 'thermalctld' not working and 'show platform fan' and 'show platfomr temperature' commands not working. _thermal_list array inside PSU class was not initialized. Made changes to attach the PSU related thermal sensors in the PSU instance. How I did it Added a common class pddf_fan_drawer.py. This class uses the PDDF JSON to fetch the platform specific data. A platform which uses PDDF would follow the below hierarchy. fan_drawer_base.py ---> pddf_fan_drawer.py ---> fan_drawer.py How to verify it Run the 'show platform fan' and 'show platform temperature' commands and check the o/p. o/p on AS7326: root@sonic:/home/admin# show platform fan s Drawer LED FAN Speed Direction Presence Status Timestamp -------- ----- ---------- ------- ----------- ---------- -------- ----------------- Fantray1 green Fantray1_1 38% EXHAUST Present OK 20220311 04:15:03 Fantray1 green Fantray1_2 38% EXHAUST Present OK 20220311 04:15:03 Fantray2 green Fantray2_1 38% EXHAUST Present OK 20220311 04:15:03 Fantray2 green Fantray2_2 38% EXHAUST Present OK 20220311 04:15:03 Fantray3 green Fantray3_1 38% EXHAUST Present OK 20220311 04:15:03 Fantray3 green Fantray3_2 38% EXHAUST Present OK 20220311 04:15:03 Fantray4 green Fantray4_1 38% EXHAUST Present OK 20220311 04:15:03 Fantray4 green Fantray4_2 38% EXHAUST Present OK 20220311 04:15:03 Fantray5 green Fantray5_1 38% EXHAUST Present OK 20220311 04:15:03 Fantray5 green Fantray5_2 38% EXHAUST Present OK 20220311 04:15:03 Fantray6 green Fantray6_1 38% EXHAUST Present OK 20220311 04:15:03 Fantray6 green Fantray6_2 38% EXHAUST Present OK 20220311 04:15:03 N/A off PSU1_FAN1 0% Present Not OK 20220311 04:15:05 N/A green PSU2_FAN1 34% EXHAUST Present OK 20220311 04:15:05 hroot@sonic:/home/admin# show platform temperature Sensor Temperature High TH Low TH Crit High TH Crit Low TH Warning Timestamp ---------- ------------- --------- -------- -------------- ------------- --------- ----------------- PSU1_TEMP1 0 N/A N/A N/A N/A False 20220311 04:15:05 PSU2_TEMP1 37 N/A N/A N/A N/A False 20220311 04:15:05 TEMP1 37 80.0 N/A N/A N/A False 20220311 04:15:05 TEMP2 27 80.0 N/A N/A N/A False 20220311 04:15:05 TEMP3 28.5 80.0 N/A N/A N/A False 20220311 04:15:05 TEMP4 30.5 80.0 N/A N/A N/A False 20220311 04:15:05 root@sonic:/home/admin# root@sonic:/home/admin# root@sonic:/home/admin# o/p on AS7726: root@as7726-32x-2:~# show platform fan Drawer LED FAN Speed Direction Presence Status Timestamp -------- ----- ---------- ------- ----------- ---------- -------- ----------------- Fantray1 green Fantray1_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray1 green Fantray1_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray2 green Fantray2_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray2 green Fantray2_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray3 green Fantray3_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray3 green Fantray3_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray4 green Fantray4_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray4 green Fantray4_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray5 green Fantray5_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray5 green Fantray5_2 38% EXHAUST Present OK 20220311 08:13:04 Fantray6 green Fantray6_1 38% EXHAUST Present OK 20220311 08:13:04 Fantray6 green Fantray6_2 38% EXHAUST Present OK 20220311 08:13:04 N/A green PSU1_FAN1 23% EXHAUST Present OK 20220311 08:13:04 N/A green PSU2_FAN1 22% EXHAUST Present OK 20220311 08:13:04 root@as7726-32x-2:~# show platform temp Sensor Temperature High TH Low TH Crit High TH Crit Low TH Warning Timestamp ---------- ------------- --------- -------- -------------- ------------- --------- ----------------- PSU1_TEMP1 28 N/A N/A N/A N/A False 20220311 08:13:04 PSU2_TEMP1 25 N/A N/A N/A N/A False 20220311 08:13:04 TEMP1 23.5 80.0 N/A N/A N/A False 20220311 08:13:04 TEMP2 27 80.0 N/A N/A N/A False 20220311 08:13:04 TEMP3 24 80.0 N/A N/A N/A False 20220311 08:13:04 TEMP4 27 80.0 N/A N/A N/A False 20220311 08:13:04 TEMP5 24 80.0 N/A N/A N/A False 20220311 08:13:04
- Loading branch information