From c6178259fcafc1ab5cdf3cd77c9ebd3ea594065a Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Thu, 25 Feb 2021 11:20:53 -0800 Subject: [PATCH] [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. --- device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py | 2 ++ device/celestica/x86_64-cel_e1031-r0/sonic_platform/watchdog.py | 1 + .../celestica/x86_64-cel_seastone-r0/sonic_platform/thermal.py | 1 + .../celestica/x86_64-cel_seastone-r0/sonic_platform/watchdog.py | 2 ++ .../x86_64-cel_seastone_2-r0/sonic_platform_config/watchdog.py | 2 ++ .../celestica/x86_64-cel_silverstone-r0/sonic_platform/fan.py | 1 + 6 files changed, 9 insertions(+) diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py index 157f49a7c3e2..6c73845287cd 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py @@ -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 diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/watchdog.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/watchdog.py index 882285251784..6db0508cb845 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/watchdog.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/watchdog.py @@ -53,6 +53,7 @@ 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 diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal.py index 2b38ef94d6c4..3848f9340541 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal.py @@ -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 diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/watchdog.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/watchdog.py index 31bb911d2401..5ab79309f0fe 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/watchdog.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/watchdog.py @@ -31,6 +31,8 @@ class Watchdog(WatchdogBase): def __init__(self): + WatchdogBase.__init__(self) + # Init helper self._api_helper = APIHelper() diff --git a/device/celestica/x86_64-cel_seastone_2-r0/sonic_platform_config/watchdog.py b/device/celestica/x86_64-cel_seastone_2-r0/sonic_platform_config/watchdog.py index cc87c3d6b32a..fac5c40e134f 100644 --- a/device/celestica/x86_64-cel_seastone_2-r0/sonic_platform_config/watchdog.py +++ b/device/celestica/x86_64-cel_seastone_2-r0/sonic_platform_config/watchdog.py @@ -29,6 +29,8 @@ class Watchdog(WatchdogBase): def __init__(self): + WatchdogBase.__init__(self) + self._api_common = Common() # Init cpld reg path diff --git a/device/celestica/x86_64-cel_silverstone-r0/sonic_platform/fan.py b/device/celestica/x86_64-cel_silverstone-r0/sonic_platform/fan.py index 1055aee68fc7..1a18eed9c8d5 100644 --- a/device/celestica/x86_64-cel_silverstone-r0/sonic_platform/fan.py +++ b/device/celestica/x86_64-cel_silverstone-r0/sonic_platform/fan.py @@ -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