[Mellanox] Ensure concrete platform API classes call base class initializer (#6854)

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:06:22 -08:00 committed by GitHub
parent 66e3e51f70
commit 516ff8bfff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 0 deletions

View File

@ -323,6 +323,7 @@ class ONIEUpdater(object):
class Component(ComponentBase):
def __init__(self):
super(Component, self).__init__()
self.name = None
self.description = None
self.image_ext_name = None

View File

@ -393,6 +393,7 @@ class Thermal(ThermalBase):
"""
index should be a string for category ambient and int for other categories
"""
super(Thermal, self).__init__()
if category == THERMAL_DEV_CATEGORY_AMBIENT:
self.name = thermal_ambient_name[index]
self.index = index

View File

@ -63,6 +63,7 @@ class WatchdogImplBase(WatchdogBase):
Open a watchdog handle
@param wd_device_path Path to watchdog device
"""
super(WatchdogImplBase, self).__init__()
self.watchdog_path = wd_device_path
self.watchdog = os.open(self.watchdog_path, os.O_WRONLY)