-
Notifications
You must be signed in to change notification settings - Fork 37
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
Supermicro X13 inventory/firmware support FS-1671 #394
base: main
Are you sure you want to change the base?
Conversation
b826034
to
5519890
Compare
@@ -300,6 +320,11 @@ func (c *Client) bmcQueryor(ctx context.Context) (bmcQueryor, error) { | |||
return nil, errors.Wrap(ErrModelUnknown, err.Error()) | |||
} | |||
|
|||
// ensure the device model matches the expected queryor | |||
if !expected(deviceModel, bmc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include a bmc.Close()
before the continue here to ensure we don't leave a successful connection open
@@ -303,8 +334,8 @@ func (c *Client) bmcQueryor(ctx context.Context) (bmcQueryor, error) { | |||
} | |||
|
|||
model := strings.ToLower(queryor.deviceModel()) | |||
if !strings.HasPrefix(model, "x12") && !strings.HasPrefix(model, "x11") { | |||
return nil, errors.Wrap(ErrModelUnsupported, "expected one of X11* or X12*, got:"+model) | |||
if !strings.HasPrefix(model, "x13") && !strings.HasPrefix(model, "x12") && !strings.HasPrefix(model, "x11") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With your new expected
function I don't think you'll actually get here if it's not x11
, x12
, or x13
. I think the queryor nil check @ 301 covers you.
// For X13 the full Task structure is returned in the body. If we can Unmarshall then we can safely assume | ||
// that redfishTask.ID contains the ID. | ||
redfishTask := &redfish.Task{} | ||
err = json.Unmarshal(response, redfishTask) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note, if response is valid JSON but isn't a redfish.Task
I believe you'll get no error and zero value for the Task
. It might be worth a sanity check that the task id isn't an empty string here.
…roper X13 model(s)
…, then pull TaskID from there directly
c7d0deb
to
2a3bfc2
Compare
What does this PR implement/change/remove?
Support for hw inventory and firmware management for Supermicro X13 boards.
The HW vendor this change applies to (if applicable)
Supermicro
The HW model number, product name this change applies to (if applicable)
X13
Description for changelog/release notes