Skip to content

Commit

Permalink
[chassis]update the way to get the chassis name to using onie_platfor…
Browse files Browse the repository at this point in the history
…m info
  • Loading branch information
Stephen Sun committed Dec 18, 2019
1 parent 30a4ae7 commit 9477140
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
try:
from sonic_platform_base.chassis_base import ChassisBase
from sonic_platform_base.component_base import ComponentBase
from sonic_device_util import get_machine_info
from sonic_daemon_base.daemon_base import Logger
from os import listdir
from os.path import isfile, join
Expand Down Expand Up @@ -54,7 +55,11 @@ def __init__(self):

# Initialize SKU name
self.sku_name = self._get_sku_name()
self.name = self.sku_name
mi = get_machine_info()
if mi is not None:
self.name = mi['onie_platform']
else:
self.name = self.sku_name

# move the initialization of each components to their dedicated initializer
# which will be called from platform
Expand Down

0 comments on commit 9477140

Please sign in to comment.