File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change
1
+ //
2
+ // SPDX-License-Identifier: BSD-3-Clause
3
+ //
4
+
1
5
package smc
2
6
3
7
import (
@@ -61,15 +65,15 @@ func FromDrive(drive *redfish.Drive) (Drive, error) {
61
65
// in the Oem sections - certain models and bmc firmwares will mix
62
66
// these up, so we check both
63
67
smcDrive .indicateTarget = t .Actions .Oem .DriveIndicate .Target
64
- if len ( t .Actions .Oem .SmcDriveIndicate .Target ) > 0 {
68
+ if t .Actions .Oem .SmcDriveIndicate .Target != "" {
65
69
smcDrive .indicateTarget = t .Actions .Oem .SmcDriveIndicate .Target
66
70
}
67
71
68
72
return smcDrive , nil
69
73
}
70
74
71
75
// Indicate will set the indicator light activity, true for on, false for off
72
- func (d Drive ) Indicate (active bool ) error {
76
+ func (d * Drive ) Indicate (active bool ) error {
73
77
// Return a common error to let the user try falling back on the normal gofish path
74
78
if d .indicateTarget == "" {
75
79
return ErrActionNotSupported
Original file line number Diff line number Diff line change
1
+ //
2
+ // SPDX-License-Identifier: BSD-3-Clause
3
+ //
4
+
1
5
package smc
2
6
3
7
import (
@@ -58,7 +62,7 @@ func TestSmcDriveOem(t *testing.T) {
58
62
}
59
63
60
64
if smcDrive .Temperature != 33 {
61
- t .Errorf ("unexpected oem drive temerature : %d" , smcDrive .Temperature )
65
+ t .Errorf ("unexpected oem drive temperature : %d" , smcDrive .Temperature )
62
66
}
63
67
64
68
if smcDrive .indicateTarget != "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.22/Actions/Oem/Drive.Indicate" {
You can’t perform that action at this time.
0 commit comments