Open FunForNOS opened 2 years ago
It should be system-health CLI module issue. There are no initizalize_system_led or initialize_system_led defined in sonic_platform_base, and obviously the function name invoked in system-health module is a typo. Even if it need to initialize_system_led, it should put the logic into platform code, instead of this high level system-health CLI module.
Add initizalize_system_led into sonic_platform chassis module is just a workaround, not a good solution for this issue. My suggestion is to remove chassis.initizalize_system_led() call in system_health module.
@qiluo-msft Glad to hear your thoughts about this issue, if there are some reasons not adequately considered to keep the chassis.initizalize_system_led() (also the name is a typo) in sonic_utilities/show/system_health.py.
@shlomibitton Can you share your opinion about the necessity to keep chassis.initizalize_system_led() in system_health CLI module?
@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:
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?
Kind regards, FunForNOS
PS: or should I have commented the PR instead?
Can confirm this bug is fixed. Tested with build id 207726.
Issue #9530 seems to be a duplicate.
Context seems to be missing, is there a reason to keep chassis.initizalize_system_led
at all? Most platforms seem to make this a no-op method, the method name is still a typo, and is still not included in chassis_base.py
.
If chassis.initizalize_system_led
is actually needed, this API needs documentation to explain exactly what purpose it serves; if kept, it also should likely come before the manager.check
call here, not after: https://github.com/sonic-net/sonic-utilities/blob/master/show/system_health.py#L30
healthd
does not call chassis.initizalize_system_led
at all (https://github.com/sonic-net/sonic-buildimage/blob/master/src/system-health/scripts/healthd#L76), implying any system led initialization should be performed as part of the chassis
object initialization.
I would request chassis.initizalize_system_led
be removed from system_health.py
as this causes conflicts between healthd
and show system-health
.
I am also surprised to see that show system-health
(system_health.py
) does not consume the database details populated by healthd
and instead just reruns the health checker locally for each invocation of show system-health
. Is this intentional? Other CLIs (such as fan, temperature, psu, etc.) do not work this way, and consume the database details populated by the corresponding services (thermalctld, psud, etc.).
Description
the command
sudo show system-health detail
fails with 'Chassis' object has no attribute 'initizalize_system_led'.Steps to reproduce the issue:
sudo show system-health detail
Describe the results you received:
Output:
Describe the results you expected:
The command completes without error and shows details of the systems health.
Output of
show version
:Output of
show techsupport
: