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

[device/celestica]: Fix xcvrd error #3979

Merged
merged 3 commits into from
Jan 10, 2020
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
3 changes: 3 additions & 0 deletions device/celestica/x86_64-cel_e1031-r0/pmon_daemon_control.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"skip_ledd": true
}
19 changes: 16 additions & 3 deletions device/celestica/x86_64-cel_e1031-r0/sonic_platform/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from sonic_platform.fan import Fan
from sonic_platform.psu import Psu
from sonic_platform.component import Component
from sonic_platform.watchdog import Watchdog
from sonic_platform.thermal import Thermal
from sonic_platform.sfp import Sfp
from sonic_platform.eeprom import Tlv
Expand Down Expand Up @@ -54,7 +53,9 @@ def __init__(self):
for index in range(0, NUM_THERMAL):
thermal = Thermal(index)
self._thermal_list.append(thermal)
for index in range(0, NUM_SFP):
# sfp index start from 1
self._sfp_list.append(None)
for index in range(1, NUM_SFP+1):
sfp = Sfp(index)
self._sfp_list.append(sfp)
for index in range(0, NUM_COMPONENT):
Expand All @@ -63,7 +64,6 @@ def __init__(self):
self._reboot_cause_path = HOST_REBOOT_CAUSE_PATH if self.__is_host(
) else PMON_REBOOT_CAUSE_PATH

self._watchdog = Watchdog()
self._eeprom = Tlv()

def __is_host(self):
Expand Down Expand Up @@ -134,3 +134,16 @@ def get_reboot_cause(self):
description = 'Unknown reason'

return (reboot_cause, description)

def get_watchdog(self):
"""
Retreives hardware watchdog device on this chassis
Returns:
An object derived from WatchdogBase representing the hardware
watchdog device
"""
if self._watchdog is None:
from sonic_platform.watchdog import Watchdog
self._watchdog = Watchdog()

return self._watchdog
2 changes: 1 addition & 1 deletion device/celestica/x86_64-cel_e1031-r0/sonic_platform/sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Sfp(SfpBase):
def __init__(self, sfp_index):
# Init index
self.index = sfp_index
self.port_num = self.index + 1
self.port_num = self.index

# Init eeprom path
eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"skip_ledd": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"skip_ledd": true
}
19 changes: 16 additions & 3 deletions device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from sonic_platform.fan import Fan
from sonic_platform.psu import Psu
from sonic_platform.component import Component
from sonic_platform.watchdog import Watchdog
from sonic_platform.thermal import Thermal
from sonic_platform.sfp import Sfp
from sonic_platform.eeprom import Tlv
Expand Down Expand Up @@ -56,14 +55,15 @@ def __init__(self):
for index in range(0, NUM_THERMAL):
thermal = Thermal(index)
self._thermal_list.append(thermal)
for index in range(0, NUM_SFP):
# sfp index start from 1
self._sfp_list.append(None)
for index in range(1, NUM_SFP+1):
sfp = Sfp(index)
self._sfp_list.append(sfp)
for index in range(0, NUM_COMPONENT):
component = Component(index)
self._component_list.append(component)

self._watchdog = Watchdog()
self._eeprom = Tlv()

def __is_host(self):
Expand Down Expand Up @@ -146,3 +146,16 @@ def get_reboot_cause(self):
description = 'Unknown reason'

return (reboot_cause, description)

def get_watchdog(self):
"""
Retreives hardware watchdog device on this chassis
Returns:
An object derived from WatchdogBase representing the hardware
watchdog device
"""
if self._watchdog is None:
from sonic_platform.watchdog import Watchdog
self._watchdog = Watchdog()

return self._watchdog
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Sfp(SfpBase):
def __init__(self, sfp_index):
# Init index
self.index = sfp_index
self.port_num = self.index + 1 if self.PORT_START == 1 else index
self.port_num = self.index

# Init eeprom path
eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"skip_ledd": true
}