celestica: reallocate the empty LIST at the constructor of subclasses (#3738)
Signed-off-by: Dante Su <dante.su@broadcom.com>
This commit is contained in:
parent
c07ae3b16f
commit
473fc6d4f3
@ -42,6 +42,7 @@ class Chassis(ChassisBase):
|
|||||||
"""Platform-specific Chassis class"""
|
"""Platform-specific Chassis class"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
ChassisBase.__init__(self)
|
||||||
self.config_data = {}
|
self.config_data = {}
|
||||||
for fant_index in range(0, NUM_FAN_TRAY):
|
for fant_index in range(0, NUM_FAN_TRAY):
|
||||||
for fan_index in range(0, NUM_FAN):
|
for fan_index in range(0, NUM_FAN):
|
||||||
@ -59,7 +60,6 @@ class Chassis(ChassisBase):
|
|||||||
for index in range(0, NUM_COMPONENT):
|
for index in range(0, NUM_COMPONENT):
|
||||||
component = Component(index)
|
component = Component(index)
|
||||||
self._component_list.append(component)
|
self._component_list.append(component)
|
||||||
ChassisBase.__init__(self)
|
|
||||||
self._reboot_cause_path = HOST_REBOOT_CAUSE_PATH if self.__is_host(
|
self._reboot_cause_path = HOST_REBOOT_CAUSE_PATH if self.__is_host(
|
||||||
) else PMON_REBOOT_CAUSE_PATH
|
) else PMON_REBOOT_CAUSE_PATH
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ class Chassis(ChassisBase):
|
|||||||
"""Platform-specific Chassis class"""
|
"""Platform-specific Chassis class"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
ChassisBase.__init__(self)
|
||||||
self.config_data = {}
|
self.config_data = {}
|
||||||
for fant_index in range(0, NUM_FAN_TRAY):
|
for fant_index in range(0, NUM_FAN_TRAY):
|
||||||
for fan_index in range(0, NUM_FAN):
|
for fan_index in range(0, NUM_FAN):
|
||||||
@ -61,7 +62,6 @@ class Chassis(ChassisBase):
|
|||||||
for index in range(0, NUM_COMPONENT):
|
for index in range(0, NUM_COMPONENT):
|
||||||
component = Component(index)
|
component = Component(index)
|
||||||
self._component_list.append(component)
|
self._component_list.append(component)
|
||||||
ChassisBase.__init__(self)
|
|
||||||
|
|
||||||
self._watchdog = Watchdog()
|
self._watchdog = Watchdog()
|
||||||
self._eeprom = Tlv()
|
self._eeprom = Tlv()
|
||||||
|
@ -39,6 +39,7 @@ class Psu(PsuBase):
|
|||||||
"""Platform-specific Psu class"""
|
"""Platform-specific Psu class"""
|
||||||
|
|
||||||
def __init__(self, psu_index):
|
def __init__(self, psu_index):
|
||||||
|
PsuBase.__init__(self)
|
||||||
self.index = psu_index
|
self.index = psu_index
|
||||||
self.green_led_path = GREEN_LED_PATH.format(self.index+1)
|
self.green_led_path = GREEN_LED_PATH.format(self.index+1)
|
||||||
self.dx010_psu_gpio = [
|
self.dx010_psu_gpio = [
|
||||||
@ -52,7 +53,6 @@ class Psu(PsuBase):
|
|||||||
for fan_index in range(0, PSU_NUM_FAN[self.index]):
|
for fan_index in range(0, PSU_NUM_FAN[self.index]):
|
||||||
fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index)
|
fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index)
|
||||||
self._fan_list.append(fan)
|
self._fan_list.append(fan)
|
||||||
PsuBase.__init__(self)
|
|
||||||
|
|
||||||
def __read_txt_file(self, file_path):
|
def __read_txt_file(self, file_path):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user