[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:
Joe LeVeque 2021-02-25 11:20:53 -08:00 committed by GitHub
parent ac15a42c57
commit c6178259fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 0 deletions

View File

@ -25,6 +25,8 @@ class Thermal(ThermalBase):
SS_CONFIG_PATH = "/usr/share/sonic/device/x86_64-cel_e1031-r0/sensors.conf"
def __init__(self, thermal_index):
ThermalBase.__init__(self)
self.index = thermal_index
# Add thermal name

View File

@ -53,6 +53,7 @@ WDT_SYSFS_PATH = "/sys/class/watchdog/"
class Watchdog(WatchdogBase):
def __init__(self):
WatchdogBase.__init__(self)
self.watchdog, self.wdt_main_dev_name = self._get_wdt()
self.status_path = "/sys/class/watchdog/%s/status" % self.wdt_main_dev_name

View File

@ -67,6 +67,7 @@ class Thermal(ThermalBase):
SS_CONFIG_PATH = "/usr/share/sonic/device/x86_64-cel_seastone-r0/sensors.conf"
def __init__(self, thermal_index, airflow):
ThermalBase.__init__(self)
self.index = thermal_index
self._api_helper = APIHelper()
self._airflow = airflow

View File

@ -31,6 +31,8 @@ WDT_COMMON_ERROR = -1
class Watchdog(WatchdogBase):
def __init__(self):
WatchdogBase.__init__(self)
# Init helper
self._api_helper = APIHelper()

View File

@ -29,6 +29,8 @@ WDT_COMMON_ERROR = -1
class Watchdog(WatchdogBase):
def __init__(self):
WatchdogBase.__init__(self)
self._api_common = Common()
# Init cpld reg path

View File

@ -54,6 +54,7 @@ class Fan(FanBase):
"""Platform-specific Fan class"""
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_tray_index = fan_tray_index
self.is_psu_fan = is_psu_fan