Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DellEMC] Ensure concrete platform API classes call base class initializer #6853

Merged
merged 1 commit into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Component(ComponentBase):
]

def __init__(self, component_index = 0):
ComponentBase.__init__(self)
self.index = component_index
self.name = self.CHASSIS_COMPONENTS[self.index][0]
self.description = self.CHASSIS_COMPONENTS[self.index][1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Fan(FanBase):

def __init__(self, fantray_index=1, fan_index=1, psu_fan=False,
dependency=None):
FanBase.__init__(self)
self.is_psu_fan = psu_fan
if not self.is_psu_fan:
# API index is starting from 0, DellEMC platform index is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Watchdog(WatchdogBase):
CLOCK_MONOTONIC = 1

def __init__(self):
WatchdogBase.__init__(self)
self._librt = ctypes.CDLL('librt.so.1', use_errno=True)
self._clock_gettime = self._librt.clock_gettime
self._clock_gettime.argtypes=[ctypes.c_int, ctypes.POINTER(_timespec)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Component(ComponentBase):
]

def __init__(self, component_index):
ComponentBase.__init__(self)
self.index = component_index
self.name = self.CHASSIS_COMPONENTS[self.index][0]
self.description = self.CHASSIS_COMPONENTS[self.index][1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Fan(FanBase):

def __init__(self, fantray_index=1, fan_index=1,
psu_index=1, psu_fan=False, dependency=None):
FanBase.__init__(self)
self.is_psu_fan = psu_fan
self.is_driver_initialized = True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Thermal(ThermalBase):

def __init__(self, thermal_index,
psu_index=1, psu_thermal=False, dependency=None):
ThermalBase.__init__(self)
self.is_psu_thermal = psu_thermal
self.dependency = dependency
self.is_driver_initialized = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Component(ComponentBase):
def __init__(self, component_index=0,
is_module=False, iom_index=0, i2c_line=0, dependency=None):

ComponentBase.__init__(self)
self.is_module_component = is_module
self.dependency = dependency

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Fan(FanBase):
MAILBOX_DIR = HWMON_DIR + HWMON_NODE

def __init__(self, fantray_index=1, psu_index=1, psu_fan=False, dependency=None):
FanBase.__init__(self)
self.is_psu_fan = psu_fan
if not self.is_psu_fan:
self.fantrayindex = fantray_index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Thermal(ThermalBase):
)

def __init__(self, thermal_index):
ThermalBase.__init__(self)
self.is_cpu_thermal = False
self.index = thermal_index + 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Watchdog(WatchdogBase):
CLOCK_MONOTONIC = 1

def __init__(self):
WatchdogBase.__init__(self)
self._librt = ctypes.CDLL('librt.so.1', use_errno=True)
self._clock_gettime = self._librt.clock_gettime
self._clock_gettime.argtypes=[ctypes.c_int, ctypes.POINTER(_timespec)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Component(ComponentBase):
]

def __init__(self, component_index=0):
ComponentBase.__init__(self)
self.index = component_index
self.name = self.CHASSIS_COMPONENTS[self.index][0]
self.description = self.CHASSIS_COMPONENTS[self.index][1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Fan(FanBase):
MAILBOX_DIR = HWMON_DIR + HWMON_NODE

def __init__(self, fantray_index=1, fan_index=1, psu_fan=False):
FanBase.__init__(self)
self.is_psu_fan = psu_fan
if not self.is_psu_fan:
# API index is starting from 0, DellEMC platform index is starting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Psu(PsuBase):
MAILBOX_DIR = HWMON_DIR + HWMON_NODE

def __init__(self, psu_index):
PsuBase.__init__(self)
# PSU is 1-based in DellEMC platforms
self.index = psu_index + 1
self.psu_presence_reg = "psu{}_presence".format(self.index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Thermal(ThermalBase):
)

def __init__(self, thermal_index):
ThermalBase.__init__(self)
self.is_cpu_thermal = False
self.index = thermal_index + 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Component(ComponentBase):
"port transceivers (65 and 66)")],
]
def __init__(self, component_index=0):
ComponentBase.__init__(self)
self.index = component_index
self.name = self.CHASSIS_COMPONENTS[self.index][0]
self.description = self.CHASSIS_COMPONENTS[self.index][1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Fan(FanBase):

def __init__(self, fantray_index=1, fan_index=1, psu_fan=False,
dependency=None):
FanBase.__init__(self)
self.is_psu_fan = psu_fan
if not self.is_psu_fan:
# API index is starting from 0, DellEMC platform index is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Watchdog(WatchdogBase):
CLOCK_MONOTONIC = 1

def __init__(self):
WatchdogBase.__init__(self)
self._librt = ctypes.CDLL('librt.so.1', use_errno=True)
self._clock_gettime = self._librt.clock_gettime
self._clock_gettime.argtypes=[ctypes.c_int, ctypes.POINTER(_timespec)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class Component(ComponentBase):
]

def __init__(self, component_index = 0):
ComponentBase.__init__(self)
self.index = component_index
self.name = self.CHASSIS_COMPONENTS[self.index][0]
self.description = self.CHASSIS_COMPONENTS[self.index][1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Fan(FanBase):
PSU_FRU_MAPPING = { 1: 3, 2: 4 }

def __init__(self, fantray_index=1, fan_index=1, psu_fan=False, dependency=None):
FanBase.__init__(self)
self.is_psu_fan = psu_fan
if not self.is_psu_fan:
# API index is starting from 0, DellEMC platform index is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Watchdog(WatchdogBase):
CLOCK_MONOTONIC = 1

def __init__(self):
WatchdogBase.__init__(self)
self._librt = ctypes.CDLL('librt.so.1', use_errno=True)
self._clock_gettime = self._librt.clock_gettime
self._clock_gettime.argtypes=[ctypes.c_int, ctypes.POINTER(_timespec)]
Expand Down