Skip to content
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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

splaspood
Copy link
Collaborator

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

Supermicro X13 inventory/firmware support FS-1671

@splaspood splaspood force-pushed the fs-1671-supermicro-x13-0 branch 2 times, most recently from b826034 to 5519890 Compare August 27, 2024 17:26
@@ -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) {
Copy link
Member

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") {
Copy link
Collaborator

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)
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants