File tree 1 file changed +28
-0
lines changed
device/celestica/x86_64-cel_seastone_2-r0/sonic_platform
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,34 @@ def get_speed_tolerance(self):
156
156
157
157
# return False
158
158
159
+ def get_status_led (self ):
160
+ """
161
+ Gets the state of the fan status LED
162
+ Returns:
163
+ A string, one of the predefined STATUS_LED_COLOR_* strings above
164
+
165
+ Note:
166
+ STATUS_LED_COLOR_GREEN = "green"
167
+ STATUS_LED_COLOR_AMBER = "amber"
168
+ STATUS_LED_COLOR_RED = "red"
169
+ STATUS_LED_COLOR_OFF = "off"
170
+ """
171
+
172
+ status_led = self .STATUS_LED_COLOR_OFF
173
+ f_name = inspect .stack ()[0 ][3 ]
174
+ config = self ._config .get (f_name )
175
+
176
+ if self .is_psu_fan :
177
+ # Not support
178
+ return self .STATUS_LED_COLOR_OFF
179
+ elif self .get_presence ():
180
+ if config .get ('oper_type' ) == Common .OPER_IMPI :
181
+ full_cmd = config ['template' ].format (config ['command' ][self .fan_index ])
182
+ status , result = self ._api_common .run_command (full_cmd )
183
+ status_led = eval (config ['formula' ].format (result ))
184
+
185
+ return status_led
186
+
159
187
# def set_status_led(self, color):
160
188
# """
161
189
# Sets the state of the fan module status LED
You can’t perform that action at this time.
0 commit comments