[BFN] Removed thermal manager for BMC-based platforms (#9883)
* Remove tm and all dependancies Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com> * Removed line connected with thermal_manager Signed-off-by: Vadym Yashchenko <vadymx.yashchenko@intel.com>
This commit is contained in:
parent
7a3a433b8d
commit
256c47ac49
@ -10,7 +10,6 @@ try:
|
||||
from sonic_platform.fan_drawer import fan_drawer_list_get
|
||||
from sonic_platform.thermal import thermal_list_get
|
||||
from eeprom import Eeprom
|
||||
from sonic_platform.thermal_manager import ThermalManager
|
||||
|
||||
from sonic_platform.platform_thrift_client import pltfm_mgr_ready
|
||||
from sonic_platform.platform_thrift_client import thrift_try
|
||||
@ -41,8 +40,6 @@ class Chassis(ChassisBase):
|
||||
self.__thermals = None
|
||||
self.__psu_list = None
|
||||
self.__sfp_list = None
|
||||
self.__thermal_mngr = None
|
||||
self.__polling_thermal_time = 30
|
||||
|
||||
self.ready = False
|
||||
self.phy_port_cur_state = {}
|
||||
@ -114,16 +111,6 @@ class Chassis(ChassisBase):
|
||||
def _sfp_list(self, value):
|
||||
pass
|
||||
|
||||
@property
|
||||
def _thermal_mngr(self):
|
||||
if self.__thermal_mngr is None:
|
||||
self.__thermal_mngr = ThermalManager(self.__polling_thermal_time)
|
||||
return self.__thermal_mngr
|
||||
|
||||
@_thermal_mngr.setter
|
||||
def _thermal_mngr(self, value):
|
||||
self.__thermal_mngr = ThermalManager(value)
|
||||
|
||||
def __update_port_info(self):
|
||||
def qsfp_max_port_get(client):
|
||||
return client.pltfm_mgr.pltfm_mgr_qsfp_get_max_port()
|
||||
@ -346,10 +333,3 @@ class Chassis(ChassisBase):
|
||||
specified.
|
||||
"""
|
||||
return self.system_led
|
||||
|
||||
def get_thermal_manager(self):
|
||||
return self._thermal_mngr
|
||||
|
||||
def __del__(self):
|
||||
if self.__thermal_mngr is not None:
|
||||
self.__thermal_mngr.stop()
|
||||
|
@ -1,67 +0,0 @@
|
||||
try:
|
||||
from threading import Timer
|
||||
except ImportError as e:
|
||||
raise ImportError (str(e) + "- required module not found")
|
||||
|
||||
class ThermalManager():
|
||||
def __init__(self, polling_time = 30.0):
|
||||
self.__polling_thermal_time = polling_time
|
||||
self.__thermals = None
|
||||
self.__timer = None
|
||||
self.__chassis = None
|
||||
|
||||
def start(self):
|
||||
self.work()
|
||||
self.__timer = Timer(self.__polling_thermal_time, self.start)
|
||||
self.__timer.start()
|
||||
|
||||
def work(self):
|
||||
if self.__chassis is not None:
|
||||
self.__thermals = self.__chassis._thermal_list
|
||||
for term in self.__thermals:
|
||||
self.check(term)
|
||||
|
||||
def check(self, sensor):
|
||||
temperature = sensor.get_temperature()
|
||||
if temperature is not None:
|
||||
temp_high = sensor.get_high_threshold()
|
||||
temp_low = sensor.get_low_threshold()
|
||||
if temp_high > -999.0:
|
||||
if temperature > temp_high:
|
||||
print('Sensor ', sensor.get_name(), ' temperature more then', temp_high, '!!!')
|
||||
else:
|
||||
print('Sensor ', sensor.get_name(), ' has no high temperature threshold')
|
||||
|
||||
if temp_low > -999.0:
|
||||
if temperature < temp_low:
|
||||
print('Sensor ', sensor.get_name(), ' temperature less then', temp_low, '!!!')
|
||||
else:
|
||||
print('Sensor ', sensor.get_name(), ' has no low temperature threshold')
|
||||
|
||||
def stop(self):
|
||||
if self.__timer is not None:
|
||||
self.__timer.cancel()
|
||||
|
||||
def __del__(self):
|
||||
if self.__timer is not None:
|
||||
self.__timer.cancel()
|
||||
|
||||
# for compatibility with old version
|
||||
def run_policy(self, chassis_def):
|
||||
self.__chassis = chassis_def
|
||||
|
||||
def get_interval(self):
|
||||
return self.__polling_thermal_time
|
||||
|
||||
def initialize(self):
|
||||
pass
|
||||
|
||||
def load(self, json_file):
|
||||
pass
|
||||
|
||||
def init_thermal_algorithm(self, chassis_def):
|
||||
self.__chassis = chassis_def
|
||||
self.start()
|
||||
|
||||
def deinitialize(self):
|
||||
self.stop()
|
Reference in New Issue
Block a user