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

[Celestica Seastone] fix multi sonic platform issues #13356

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

qnos
Copy link
Contributor

@qnos qnos commented Jan 13, 2023

Why I did it

Fix the following issues for Seastone platform:

  1. system-health issue: show system-health detail will not complete #9530, Celestica Seastone DX010-C32: show system-health detail fails with 'Chassis' object has no attribute 'initizalize_system_led' #11322
  2. show platform firmware updates issue: Celestica Seastone DX010-C32: show platform firmware updates #11317
  3. other platform optimization

How I did it

Modify and optimize the platform implememtation.

How to verify it

Manual run the test commands described in these issues.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

- What I did
Fix the following issues for Seastone platform:
1. system-health issue: sonic-net#9530, sonic-net#11322
2. show platform firmware updates issue: sonic-net#11317
3. other platform optimization

- How I did it
Modify and optimize the platform implememtation.

- How to verify it
Manual run the test commands described in these issues.
@qnos qnos force-pushed the cel-seastone-platform-issues-fix branch from d2eaaeb to 5b8c308 Compare January 16, 2023 01:16
@qnos
Copy link
Contributor Author

qnos commented Jan 16, 2023

@yxieca No reviewer assigned, please help to review this PR.

@FunForNOS
Copy link

FunForNOS commented Jan 16, 2023

@qnos thanks for all the efforts you put into fixing the issues.

Using the sonic build from the PR branch (https://dev.azure.com/mssonic/build/_build/results?buildId=203616&view=artifacts&pathAsName=false&type=publishedArtifacts) on one of our Seastones,
we now get a different error when running 'show system-health detail':

admin@sonic:~$ sudo show system-health detail
Traceback (most recent call last):
  File "/usr/local/bin/show", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/show/system_health.py", line 120, in detail
    manager, chassis, stat = get_system_health_status()
  File "/usr/local/lib/python3.9/dist-packages/show/system_health.py", line 10, in get_system_health_status
    if os.environ["UTILITIES_UNIT_TESTING"] == "1":
  File "/usr/lib/python3.9/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'UTILITIES_UNIT_TESTING'

Should the build be testable on real hardware or is this 'UTILITIES_UNIT_TESTING' output due to using a PR build?

Summary of 'show version' of the specific PR build
admin@sonic:~$ show version

SONiC Software Version: SONiC.master-13356.203616-0139e8d9d
Distribution: Debian 11.6
Kernel: 5.10.0-18-2-amd64
Build commit: 0139e8d9d
Build date: Mon Jan 16 02:44:03 UTC 2023
Built by: AzDevOps@vmss-soni000BGK

Platform: x86_64-cel_seastone-r0
HwSKU: Celestica-DX010
ASIC: broadcom
ASIC Count: 1
Serial Number: DX010B2F108606LK100236
Model Number: R0872-F0010-01
Hardware Revision: N/A
Uptime: 19:55:46 up 45 min,  3 users,  load average: 0.85, 1.79, 2.53
Date: Mon 16 Jan 2023 19:55:46

Docker images:
REPOSITORY                    TAG                             IMAGE ID       SIZE
docker-macsec                 latest                          12987a8e4c01   375MB
docker-dhcp-relay             latest                          b86296cf577e   366MB
docker-eventd                 latest                          9159afb93816   356MB
docker-eventd                 master-13356.203616-0139e8d9d   9159afb93816   356MB
docker-orchagent              latest                          b2a9afc7fe9b   385MB
docker-orchagent              master-13356.203616-0139e8d9d   b2a9afc7fe9b   385MB
docker-teamd                  latest                          7b894989965a   373MB
docker-teamd                  master-13356.203616-0139e8d9d   7b894989965a   373MB
docker-fpm-frr                latest                          9b59b7e075a1   402MB
docker-fpm-frr                master-13356.203616-0139e8d9d   9b59b7e075a1   402MB
docker-gbsyncd-broncos        latest                          db7effe1935b   404MB
docker-gbsyncd-broncos        master-13356.203616-0139e8d9d   db7effe1935b   404MB
docker-gbsyncd-credo          latest                          a880e0923e1c   374MB
docker-gbsyncd-credo          master-13356.203616-0139e8d9d   a880e0923e1c   374MB
docker-sonic-telemetry        latest                          1a9542e712e1   655MB
docker-sonic-telemetry        master-13356.203616-0139e8d9d   1a9542e712e1   655MB
docker-syncd-brcm             latest                          38efaf0a167b   699MB
docker-syncd-brcm             master-13356.203616-0139e8d9d   38efaf0a167b   699MB
docker-snmp                   latest                          46180872509d   396MB
docker-snmp                   master-13356.203616-0139e8d9d   46180872509d   396MB
docker-router-advertiser      latest                          80774f84b2dc   356MB
docker-router-advertiser      master-13356.203616-0139e8d9d   80774f84b2dc   356MB
docker-platform-monitor       latest                          7a9b45999e51   478MB
docker-platform-monitor       master-13356.203616-0139e8d9d   7a9b45999e51   478MB
docker-sonic-p4rt             latest                          37f2ea8de30b   927MB
docker-sonic-p4rt             master-13356.203616-0139e8d9d   37f2ea8de30b   927MB
docker-mux                    latest                          d5dd4e390b80   405MB
docker-mux                    master-13356.203616-0139e8d9d   d5dd4e390b80   405MB
docker-lldp                   latest                          a650e58e7168   399MB
docker-lldp                   master-13356.203616-0139e8d9d   a650e58e7168   399MB
docker-database               latest                          3bd7ce23baf8   356MB
docker-database               master-13356.203616-0139e8d9d   3bd7ce23baf8   356MB
docker-nat                    latest                          6440dffa811c   351MB
docker-nat                    master-13356.203616-0139e8d9d   6440dffa811c   351MB
docker-sflow                  latest                          a4eb8aeb28d6   349MB
docker-sflow                  master-13356.203616-0139e8d9d   a4eb8aeb28d6   349MB
docker-sonic-mgmt-framework   latest                          ae83fe36bb67   477MB
docker-sonic-mgmt-framework   master-13356.203616-0139e8d9d   ae83fe36bb67   477MB

Kind regards,
FunForNOS

@FunForNOS
Copy link

Unfortunately the command 'show platform firmware updates' still yields the same error

admin@sonic:~$ show platform firmware updates
Error: Chassis names mismatch: keys=['Celestica-DX010', 'Seastone-DX010']. Aborting...
Aborted!

Kind regards,
FunForNOS

@FunForNOS
Copy link

FunForNOS commented Jan 16, 2023

Using the PR build, the following issues are fixed:

Output of show platform syseeprom
admin@sonic:~$ show platform syseeprom
TlvInfo Header:
   Id String:    TlvInfo
   Version:      1
   Total Length: 167
TLV Name             Code      Len  Value
-------------------  ------  -----  ----------------------
Product Name         0x21        5  DX010
Part Number          0x22       14  R0872-F0010-01
Serial Number        0x23       22  DX010B2F108606LK******
Base MAC Address     0x24        6  00:E0:EC:XX:XX:XX
Manufacture Date     0x25       19  06/14/2018 15:**:**
Device Version       0x26        1  10
Label Revision       0x27        8  Seastone
Platform Name        0x28        8  RANGELEY
ONIE Version         0x29       13  2021.08.0.0.4
MAC Addresses        0x2A        2  131
Manufacturer         0x2B        9  CELESTICA
Manufacture Country  0x2C        3  CHN
Vendor Name          0x2D        9  Celestica
Diag Version         0x2E        5  1.1.1
Service Tag          0x2F        2  LB
Vendor Extension     0xFD        3  0x2F 0xD4 0xBF
CRC-32               0xFE        4  0x523F****
Output of show platform summary
admin@sonic:~$ show platform summary
Platform: x86_64-cel_seastone-r0
HwSKU: Celestica-DX010
ASIC: broadcom
ASIC Count: 1
Serial Number: DX010B2F108606LK******
Model Number: R0872-F0010-01
Hardware Revision: N/A
Output of show platform psustatus
admin@sonic:~$ show platform psustatus
PSU    Model           Serial          HW Rev      Voltage (V)    Current (A)    Power (W)  Status    LED
-----  --------------  --------------  --------  -------------  -------------  -----------  --------  -----
PSU 1  DPS-800AB-25 D  IMED181700****  N/A               12.18           5.33        66.38  OK        green
PSU 2  DPS-800AB-25 D  IMED181700****  N/A               12.19           4.87        59.88  OK        green
Output of show platform fan
admin@sonic:~$ show platform fan
  Drawer    LED          FAN    Speed    Direction    Presence    Status          Timestamp
--------  -----  -----------  -------  -----------  ----------  --------  -----------------
 Drawer1  green       FAN-1F      35%      exhaust     Present        OK  20230116 20:19:15
 Drawer1  green       FAN-1R      35%      exhaust     Present        OK  20230116 20:19:15
 Drawer2  green       FAN-2F      35%      exhaust     Present        OK  20230116 20:19:15
 Drawer2  green       FAN-2R      35%      exhaust     Present        OK  20230116 20:19:16
 Drawer3  green       FAN-3F      35%      exhaust     Present        OK  20230116 20:19:16
 Drawer3  green       FAN-3R      35%      exhaust     Present        OK  20230116 20:19:16
 Drawer4  green       FAN-4F      35%      exhaust     Present        OK  20230116 20:19:16
 Drawer4  green       FAN-4R      35%      exhaust     Present        OK  20230116 20:19:16
 Drawer5  green       FAN-5F      35%      exhaust     Present        OK  20230116 20:19:16
 Drawer5  green       FAN-5R      35%      exhaust     Present        OK  20230116 20:19:16
     N/A  green  PSU-1 FAN-1      56%      exhaust     Present        OK  20230116 20:19:16
     N/A  green  PSU-2 FAN-1      63%      exhaust     Present        OK  20230116 20:19:16

Kind regards,
FunForNOS

@qnos
Copy link
Contributor Author

qnos commented Jan 17, 2023 via email

@qnos
Copy link
Contributor Author

qnos commented Jan 17, 2023

Unfortunately the command 'show platform firmware updates' still yields the same error

admin@sonic:~$ show platform firmware updates
Error: Chassis names mismatch: keys=['Celestica-DX010', 'Seastone-DX010']. Aborting...
Aborted!

Kind regards, FunForNOS

In my PR #13356 , I have changed the name to "Seastone-DX010" to match the default SKU, but your built still kept using "Celestica-DX010". Please review your merged code to check it.

@qnos
Copy link
Contributor Author

qnos commented Jan 17, 2023

os.environ["UTILITIES_UNIT_TESTING"]

@qiluo-msft thanks for all the efforts you put into fixing the issues.

Using the sonic build from the PR branch (https://dev.azure.com/mssonic/build/_build/results?buildId=203616&view=artifacts&pathAsName=false&type=publishedArtifacts) on one of our Seastones, we now get a different error when running 'show system-health detail':

admin@sonic:~$ sudo show system-health detail
Traceback (most recent call last):
  File "/usr/local/bin/show", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/show/system_health.py", line 120, in detail
    manager, chassis, stat = get_system_health_status()
  File "/usr/local/lib/python3.9/dist-packages/show/system_health.py", line 10, in get_system_health_status
    if os.environ["UTILITIES_UNIT_TESTING"] == "1":
  File "/usr/lib/python3.9/os.py", line 679, in __getitem__
    raise KeyError(key) from None
KeyError: 'UTILITIES_UNIT_TESTING'

Should the build be testable on real hardware or is this 'UTILITIES_UNIT_TESTING' output due to using a PR build?

Summary of 'show version' of the specific PR build
Kind regards, FunForNOS

There is a try .. except logic in /usr/local/lib/python3.9/dist-packages/show/system_health.py which would catch and handle this kind of exception. Please check if there are any differences in this build.

@system_health.command()
def detail():
    """Show system-health detail information"""
    # Mock the redis for unit test purposes #
    try:
        if os.environ["UTILITIES_UNIT_TESTING"] == "1":
            modules_path = os.path.join(os.path.dirname(__file__), "..")
            sys.path.insert(0, modules_path)
            from tests.system_health_test import MockerManager
            from tests.system_health_test import MockerChassis
            HealthCheckerManager = MockerManager
            Chassis = MockerChassis
    except Exception:
        # Normal run... #
        if os.geteuid():
            click.echo("Root privileges are required for this operation")
            return
        from health_checker.manager import HealthCheckerManager
        from sonic_platform.chassis import Chassis

@FunForNOS
Copy link

FunForNOS commented Jan 17, 2023

Hi qnos,

I did not build Azure Sonic on my own. Instead I used the build triggered by this PR.

I presumed, a PR build will create Sonic images to be installed on real hardware in order to test them before completing the PR.

Thanks for pointing this out - and sorry for the typo in your username, @qnos.

Hello, In my PR, I have changed the name to "Seastone-DX010" to match the default SKU, but your built still kept using "Celestica-DX010". Please review your merged code to check it. https://github.com/sonic-net/sonic-buildimage/pull/13356/files

________________________________ : FunForNOS @.> 时: 2023117 4:06 占: sonic-net/sonic-buildimage @.> : Ikki Zhu @.>; Author @.> : Re: [sonic-net/sonic-buildimage] [Celestica Seastone] fix multi sonic platform issues (PR #13356) Unfortunately the command 'show platform firmware updates' still yields the same error @.:~$ show platform firmware updates Error: Chassis names mismatch: keys=['Celestica-DX010', 'Seastone-DX010']. Aborting... Aborted! Kind regards, FunForNOS Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsonic-net%2Fsonic-buildimage%2Fpull%2F13356%23issuecomment-1384502790&data=05%7C01%7C%7C914413056db5461c9f7908daf7fd3241%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638094964106215848%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=2BJLTlCe45lBW5F6HtBQjDgRvkvMLQyjpXg%2Fen7V2Tw%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAS6CKMJSEHCR2OGSGVLLC2LWSWS5FANCNFSM6AAAAAAT2AQZLM&data=05%7C01%7C%7C914413056db5461c9f7908daf7fd3241%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638094964106215848%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W4lOgahWcxp5Qf7%2B8wHB%2FaiDTz3yjIS6KzJm0pR%2Fg0Y%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.>

@qnos
Copy link
Contributor Author

qnos commented Jan 18, 2023

Hi qnos,

I did not build Azure Sonic on my own. Instead I used the build triggered by this PR.

I presumed, a PR build will create Sonic images to be installed on real hardware in order to test them before completing the PR.

Thanks for pointing this out - and sorry for the typo in your username, @qnos.

Hello, In my PR, I have changed the name to "Seastone-DX010" to match the default SKU, but your built still kept using "Celestica-DX010". Please review your merged code to check it. https://github.com/sonic-net/sonic-buildimage/pull/13356/files

________________________________ : FunForNOS @.> 时: 2023117 4:06 占: sonic-net/sonic-buildimage _@**._> : Ikki Zhu _@.>; Author @._> : Re: [sonic-net/sonic-buildimage] [Celestica Seastone] fix multi sonic platform issues (PR #13356) Unfortunately the command 'show platform firmware updates' still yields the same error _@.:~$ show platform firmware updates Error: Chassis names mismatch: keys=['Celestica-DX010', 'Seastone-DX010']. Aborting... Aborted! Kind regards, FunForNOS Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsonic-net%2Fsonic-buildimage%2Fpull%2F13356%23issuecomment-1384502790&data=05%7C01%7C%7C914413056db5461c9f7908daf7fd3241%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638094964106215848%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=2BJLTlCe45lBW5F6HtBQjDgRvkvMLQyjpXg%2Fen7V2Tw%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAS6CKMJSEHCR2OGSGVLLC2LWSWS5FANCNFSM6AAAAAAT2AQZLM&data=05%7C01%7C%7C914413056db5461c9f7908daf7fd3241%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638094964106215848%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=W4lOgahWcxp5Qf7%2B8wHB%2FaiDTz3yjIS6KzJm0pR%2Fg0Y%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.**_>

Platform: x86_64-cel_seastone-r0
HwSKU: Celestica-DX010
ASIC: broadcom
ASIC Count: 1
Serial Number: DX010B2F108606LK100236
Model Number: R0872-F0010-01
Hardware Revision: N/A
Uptime: 19:55:46 up 45 min,  3 users,  load average: 0.85, 1.79, 2.53
Date: Mon 16 Jan 2023 19:55:46

Hello FunForNOS,

I find the difference, your device got the wrong HwSKU info, Default HwSKU should be Seastone-DX010. I guess you installed the image through sonic-installer and your device had the wrong HwSKU info in config db.
Please try the following method, then check the HwSKU info and execute the 'show platform firmware updates' again.

admin@sonic:~$ sudo rm /etc/sonic/config_db.json
admin@sonic:~$ sudo config-setup factory
admin@sonic:~$ sudo reboot
# After reboot complete:
admin@sonic:~$ show platform summary 

You should see the hwsku info like this:

admin@sonic:~$ show platform summary
Platform: x86_64-cel_seastone-r0
HwSKU: Seastone-DX010
ASIC: broadcom
ASIC Count: 1

@FunForNOS
Copy link

Hi @qnos

admin@sonic:~$ sudo rm /etc/sonic/config_db.json
admin@sonic:~$ sudo config-setup factory
admin@sonic:~$ sudo reboot
# After reboot complete:
admin@sonic:~$ show platform summary

You should see the hwsku info like this:
[snip]

HwSKU: Seastone-DX010

[snip]

By resetting the sonic configuration database, the HwSKU info is now correct:

admin@sonic:~$ sudo show platform summary
Platform: x86_64-cel_seastone-r0
HwSKU: Seastone-DX010
[snip]

But 'show platform firmware updates' still fails

Error: Chassis component names mismatch: keys=['CPLD5']. Aborting...
Aborted!

with CPLD5 being introduced here.

But anyway - this means, we're a step forward :)

@FunForNOS
Copy link

May be add a dummy implementation for Chassis.initialize_system_led()?
This is called in sonic-utilities/system_health.py:32 and fixes:

Add dummy implementation for Chassis.initizalize_system_led() to satisfy call from system_health.py: - get_system_health_status().

diff --git a/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/chassis.py
index aa7671484..2322fbe39 100644
--- a/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/chassis.py
+++ b/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/chassis.py
@@ -272,6 +272,14 @@ class Chassis(ChassisBase):
 
         return self._watchdog
 
+    def initizalize_system_led(self):
+        """
+        Status LED is unsupported at the moment. Method is implemented to satisfy system_health.py - get_system_health_status()
+        Returns:
+            Always True
+        """
+        return True
+
     # ##############################################################
     # ###################### Device methods ########################
     # ##############################################################

This dummy implementation can be found > 10 times for other vendors and other platforms as well.

@qnos
Copy link
Contributor Author

qnos commented Jan 18, 2023

Hi @qnos

admin@sonic:~$ sudo rm /etc/sonic/config_db.json
admin@sonic:~$ sudo config-setup factory
admin@sonic:~$ sudo reboot
# After reboot complete:
admin@sonic:~$ show platform summary

You should see the hwsku info like this:
[snip]

HwSKU: Seastone-DX010

[snip]

By resetting the sonic configuration database, the HwSKU info is now correct:

admin@sonic:~$ sudo show platform summary
Platform: x86_64-cel_seastone-r0
HwSKU: Seastone-DX010
[snip]

But 'show platform firmware updates' still fails

Error: Chassis component names mismatch: keys=['CPLD5']. Aborting...
Aborted!

with CPLD5 being introduced here.

But anyway - this means, we're a step forward :)

Yes, CPLD5 was introduced in this PR. Please make sure platform_component.json has the CPLD5 item, and chassis.py NUM_COMPONENT is 6, then the Error would disappear. Or just make sure this PR is completed merged into code base.

@qnos
Copy link
Contributor Author

qnos commented Jan 18, 2023

May be add a dummy implementation for Chassis.initialize_system_led()? This is called in sonic-utilities/system_health.py:32 and fixes:

* [show system-health detail will not complete #9530](https://github.com/sonic-net/sonic-buildimage/issues/9530)

* [Celestica Seastone DX010-C32: show system-health detail fails with 'Chassis' object has no attribute 'initizalize_system_led' #11322](https://github.com/sonic-net/sonic-buildimage/issues/11322)
Add dummy implementation for Chassis.initizalize_system_led() to satisfy call from system_health.py: - get_system_health_status().

diff --git a/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/chassis.py
index aa7671484..2322fbe39 100644
--- a/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/chassis.py
+++ b/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/chassis.py
@@ -272,6 +272,14 @@ class Chassis(ChassisBase):
 
         return self._watchdog
 
+    def initizalize_system_led(self):
+        """
+        Status LED is unsupported at the moment. Method is implemented to satisfy system_health.py - get_system_health_status()
+        Returns:
+            Always True
+        """
+        return True
+
     # ##############################################################
     # ###################### Device methods ########################
     # ##############################################################

This dummy implementation can be found > 10 times for other vendors and other platforms as well.

My PR has added this function into chassis.py as a workaround for system-health issue.

@prgeor
Copy link
Contributor

prgeor commented Jan 19, 2023

@yxieca please cherry-pick this to 202205

@prgeor
Copy link
Contributor

prgeor commented Jan 19, 2023

@qiluo-msft please cherry-pick this to 202012

@prgeor
Copy link
Contributor

prgeor commented Jan 19, 2023

@StormLiangMS please cherry-pick to 202211

@yxieca
Copy link
Contributor

yxieca commented Jan 19, 2023

@StormLiangMS, @prgeor please hold off cherry-picking. This PR has issues needs to be addressed. @assrinivasan has the details.

qiluo-msft pushed a commit that referenced this pull request Jan 19, 2023
Why I did it
Fix the following issues for Seastone platform:

- system-health issue: show system-health detail will not complete #9530, Celestica Seastone DX010-C32: show system-health detail fails with 'Chassis' object has no attribute 'initizalize_system_led' #11322
- show platform firmware updates issue: Celestica Seastone DX010-C32: show platform firmware updates #11317
- other platform optimization

How I did it
Modify and optimize the platform implememtation.

How to verify it
Manual run the test commands described in these issues.
@qnos
Copy link
Contributor Author

qnos commented Jan 19, 2023

@StormLiangMS, @prgeor please hold off cherry-picking. This PR has issues needs to be addressed. @assrinivasan has the details.

@assrinivasan Can you give some details?

@assrinivasan
Copy link
Contributor

Hi @qnos -- there was a concern that the changed HSWKU from Celestica-DX010 to Seastone-DX010 would cause issues but we confirmed that there is no direct impact (per @prgeor) . @StormLiangMS please feel free to cherry-pick.

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Jan 23, 2023
Why I did it
Fix the following issues for Seastone platform:

- system-health issue: show system-health detail will not complete sonic-net#9530, Celestica Seastone DX010-C32: show system-health detail fails with 'Chassis' object has no attribute 'initizalize_system_led' sonic-net#11322
- show platform firmware updates issue: Celestica Seastone DX010-C32: show platform firmware updates sonic-net#11317
- other platform optimization

How I did it
Modify and optimize the platform implememtation.

How to verify it
Manual run the test commands described in these issues.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202205: #13485

@FunForNOS
Copy link

@prgeor:
I confirmed the bugs this PR addresses are fixed. Tested with build id 207726.

Somewhere it says 'review required' ... what else has to be done to review this PR?

@salvadorb
Copy link

Hi,
It looks like there's a problem with the sonic-cli as well, for example it doesn't allow to run the show mclag brief (according to this video this command should be valid https://www.youtube.com/watch?v=RHsyTFkfSLY)

admin@Celestica:~$ sonic-cli
Celestica# show 
interface ip        lldp      platform  system    
Celestica# 

Here is another example with show ip route command

Celestica# show ip route
Syntax error: Illegal command line

@prgeor
Copy link
Contributor

prgeor commented Jan 31, 2023

@prgeor: I confirmed the bugs this PR addresses are fixed. Tested with build id 207726.

Somewhere it says 'review required' ... what else has to be done to review this PR?

@FunForNOS this PR is now merged

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Feb 3, 2023
Why I did it
Fix the following issues for Seastone platform:

- system-health issue: show system-health detail will not complete sonic-net#9530, Celestica Seastone DX010-C32: show system-health detail fails with 'Chassis' object has no attribute 'initizalize_system_led' sonic-net#11322
- show platform firmware updates issue: Celestica Seastone DX010-C32: show platform firmware updates sonic-net#11317
- other platform optimization

How I did it
Modify and optimize the platform implememtation.

How to verify it
Manual run the test commands described in these issues.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202211: #13653

mssonicbld pushed a commit that referenced this pull request Feb 4, 2023
Why I did it
Fix the following issues for Seastone platform:

- system-health issue: show system-health detail will not complete #9530, Celestica Seastone DX010-C32: show system-health detail fails with 'Chassis' object has no attribute 'initizalize_system_led' #11322
- show platform firmware updates issue: Celestica Seastone DX010-C32: show platform firmware updates #11317
- other platform optimization

How I did it
Modify and optimize the platform implememtation.

How to verify it
Manual run the test commands described in these issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants