[Celestica] Ensure concrete platform API classes call base class initializer (#6852)
In preparation for the merging of Azure/sonic-platform-common#173, which properly defines class and instance members in the Platform API base classes. It is proper object-oriented methodology to call the base class initializer, even if it is only the default initializer. This also future-proofs the potential addition of custom initializers in the base classes down the road.
This commit is contained in:
parent
7748597fa2
commit
bd14dd377c
@ -25,6 +25,8 @@ class Thermal(ThermalBase):
|
|||||||
SS_CONFIG_PATH = "/usr/share/sonic/device/x86_64-cel_e1031-r0/sensors.conf"
|
SS_CONFIG_PATH = "/usr/share/sonic/device/x86_64-cel_e1031-r0/sensors.conf"
|
||||||
|
|
||||||
def __init__(self, thermal_index):
|
def __init__(self, thermal_index):
|
||||||
|
ThermalBase.__init__(self)
|
||||||
|
|
||||||
self.index = thermal_index
|
self.index = thermal_index
|
||||||
|
|
||||||
# Add thermal name
|
# Add thermal name
|
||||||
|
@ -53,6 +53,7 @@ WDT_SYSFS_PATH = "/sys/class/watchdog/"
|
|||||||
class Watchdog(WatchdogBase):
|
class Watchdog(WatchdogBase):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
WatchdogBase.__init__(self)
|
||||||
|
|
||||||
self.watchdog, self.wdt_main_dev_name = self._get_wdt()
|
self.watchdog, self.wdt_main_dev_name = self._get_wdt()
|
||||||
self.status_path = "/sys/class/watchdog/%s/status" % self.wdt_main_dev_name
|
self.status_path = "/sys/class/watchdog/%s/status" % self.wdt_main_dev_name
|
||||||
|
@ -67,6 +67,7 @@ class Thermal(ThermalBase):
|
|||||||
SS_CONFIG_PATH = "/usr/share/sonic/device/x86_64-cel_seastone-r0/sensors.conf"
|
SS_CONFIG_PATH = "/usr/share/sonic/device/x86_64-cel_seastone-r0/sensors.conf"
|
||||||
|
|
||||||
def __init__(self, thermal_index, airflow):
|
def __init__(self, thermal_index, airflow):
|
||||||
|
ThermalBase.__init__(self)
|
||||||
self.index = thermal_index
|
self.index = thermal_index
|
||||||
self._api_helper = APIHelper()
|
self._api_helper = APIHelper()
|
||||||
self._airflow = airflow
|
self._airflow = airflow
|
||||||
|
@ -31,6 +31,8 @@ WDT_COMMON_ERROR = -1
|
|||||||
class Watchdog(WatchdogBase):
|
class Watchdog(WatchdogBase):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
WatchdogBase.__init__(self)
|
||||||
|
|
||||||
# Init helper
|
# Init helper
|
||||||
self._api_helper = APIHelper()
|
self._api_helper = APIHelper()
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@ WDT_COMMON_ERROR = -1
|
|||||||
class Watchdog(WatchdogBase):
|
class Watchdog(WatchdogBase):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
WatchdogBase.__init__(self)
|
||||||
|
|
||||||
self._api_common = Common()
|
self._api_common = Common()
|
||||||
|
|
||||||
# Init cpld reg path
|
# Init cpld reg path
|
||||||
|
@ -54,6 +54,7 @@ class Fan(FanBase):
|
|||||||
"""Platform-specific Fan class"""
|
"""Platform-specific Fan class"""
|
||||||
|
|
||||||
def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0):
|
def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0):
|
||||||
|
FanBase.__init__(self)
|
||||||
self.fan_index = fan_index
|
self.fan_index = fan_index
|
||||||
self.fan_tray_index = fan_tray_index
|
self.fan_tray_index = fan_tray_index
|
||||||
self.is_psu_fan = is_psu_fan
|
self.is_psu_fan = is_psu_fan
|
||||||
|
Reference in New Issue
Block a user