sonic-buildimage/platform/broadcom/sonic-platform-modules-juniper/qfx5200/utils/show_thresholds
Ciju Rajan K 609cbdd0f3
[Juniper] Platform bug fixes / improvements (#5541)
* [Juniper] Platform bug fixes / improvements

This patch set introduces the following changes for
the two platforms.

 - QFX5210
   - Fixes a driver bug related to reboot notifier
   - Disable pcied
   - Introduces a wrapper script for fast / warm reboots
     for unloading the driver containing reboot handler
   - Support for PSM4 optics in media_settings

 - QFX5200
   - BCM configuration file updates
   - Bug fixes for EM policy
   - Fixes a driver bug related to reboot notifier
   - Introduces a wrapper script for fast / warm reboots
     for unloading the driver containing reboot handler
   - Disable pcied
   - Support for PSM4 optics

Signed-off-by: Ciju Rajan K <crajank@juniper.net>
2020-11-10 22:13:23 -08:00

44 lines
1.1 KiB
Python
Executable File

#!/usr/bin/env python
import os
import commands
def fantype_detect():
refpgaTMC_path = "/sys/devices/pci0000:00/0000:00:1c.0/0000:0f:00.0/refpga-tmc.15"
AFO = "1"
AFI = "0"
#default fan type is AFI
default_fantype = 0
for filename in os.listdir(refpgaTMC_path):
if filename.endswith('_type'):
fantype_path = os.path.join(refpgaTMC_path, filename)
cat_string = "cat "
fantype_string = cat_string + fantype_path
status,fan_type=commands.getstatusoutput(fantype_string)
if ((fan_type == AFO) or (fan_type == AFI)):
return fan_type
else:
pass
return default_fantype
def main():
AFO_value = "1"
fan_type = fantype_detect()
if fan_type == AFO_value:
temp_thres_file = open("/usr/local/bin/temperature_thresholds_AFO.txt", "r+")
print temp_thres_file.read()
else:
temp_thres_file = open("/usr/local/bin/temperature_thresholds_AFI.txt", "r+")
print temp_thres_file.read()
temp_thres_file.close()
if __name__ == "__main__":
main()