Commit 401d784
authored
Provide BMC defaults for system status LED methods in ChassisBase (#731)
* Provide BMC defaults for system status LED methods in ChassisBase
`show system-health` (sonic-utilities) calls initizalize_system_led(),
set_status_led() and get_status_led() unconditionally on the chassis, but
BMC platforms have no controllable system status LED. ChassisBase left
set/get as NotImplementedError and had no initizalize_system_led at all,
so the CLI failed on BMC images.
Provide BMC defaults in ChassisBase, gated on is_switch_bmc():
initizalize_system_led() returns True, set_status_led() returns False, and
get_status_led() returns "N/A". Non-BMC platforms are unaffected: they fall
through to NotImplementedError as before, or override these methods.
Signed-off-by: shreyansh-nexthop <shreyansh@nexthop.ai>
* Add unit tests for the ChassisBase system LED BMC defaults
Cover both branches of initizalize_system_led(), set_status_led() and
get_status_led(): the BMC defaults when is_switch_bmc() is true, and the
NotImplementedError path for non-BMC platforms.
Signed-off-by: shreyansh-nexthop <shreyansh@nexthop.ai>
---------
Signed-off-by: shreyansh-nexthop <shreyansh@nexthop.ai>1 parent 01cada1 commit 401d784
2 files changed
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
884 | 884 | | |
885 | 885 | | |
886 | 886 | | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
887 | 899 | | |
888 | 900 | | |
889 | 901 | | |
| |||
895 | 907 | | |
896 | 908 | | |
897 | 909 | | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
898 | 913 | | |
899 | 914 | | |
900 | 915 | | |
| |||
905 | 920 | | |
906 | 921 | | |
907 | 922 | | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
908 | 926 | | |
909 | 927 | | |
910 | 928 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
61 | 116 | | |
62 | 117 | | |
63 | 118 | | |
| |||
0 commit comments