diff --git a/internal/redfishwrapper/firmware.go b/internal/redfishwrapper/firmware.go index 9fdf8c7d..08ac4976 100644 --- a/internal/redfishwrapper/firmware.go +++ b/internal/redfishwrapper/firmware.go @@ -47,7 +47,7 @@ func (c *Client) FirmwareUpload(ctx context.Context, updateFile *os.File, params return "", errors.Wrap(errUpdateParams, err.Error()) } - installMethod, installURI, err := c.firmwareInstallMethodURI(ctx) + installMethod, installURI, err := c.firmwareInstallMethodURI() if err != nil { return "", errors.Wrap(bmclibErrs.ErrFirmwareUpload, err.Error()) } @@ -69,14 +69,14 @@ func (c *Client) FirmwareUpload(ctx context.Context, updateFile *os.File, params switch installMethod { case multipartHttpUpload: var uploadErr error - resp, uploadErr = c.multipartHTTPUpload(ctx, installURI, updateFile, parameters) + resp, uploadErr = c.multipartHTTPUpload(installURI, updateFile, parameters) if uploadErr != nil { return "", errors.Wrap(bmclibErrs.ErrFirmwareUpload, uploadErr.Error()) } case unstructuredHttpPush: var uploadErr error - resp, uploadErr = c.unstructuredHttpUpload(ctx, installURI, updateFile, parameters) + resp, uploadErr = c.unstructuredHttpUpload(installURI, updateFile) if uploadErr != nil { return "", errors.Wrap(bmclibErrs.ErrFirmwareUpload, uploadErr.Error()) } @@ -212,7 +212,7 @@ type multipartPayload struct { updateFile *os.File } -func (c *Client) multipartHTTPUpload(ctx context.Context, url string, update *os.File, params []byte) (*http.Response, error) { +func (c *Client) multipartHTTPUpload(url string, update *os.File, params []byte) (*http.Response, error) { if url == "" { return nil, fmt.Errorf("unable to execute request, no target provided") } @@ -226,7 +226,7 @@ func (c *Client) multipartHTTPUpload(ctx context.Context, url string, update *os return c.runRequestWithMultipartPayload(url, payload) } -func (c *Client) unstructuredHttpUpload(ctx context.Context, url string, update io.Reader, params []byte) (*http.Response, error) { +func (c *Client) unstructuredHttpUpload(url string, update io.Reader) (*http.Response, error) { if url == "" { return nil, fmt.Errorf("unable to execute request, no target provided") } @@ -240,7 +240,7 @@ func (c *Client) unstructuredHttpUpload(ctx context.Context, url string, update } // firmwareUpdateMethodURI returns the updateMethod and URI -func (c *Client) firmwareInstallMethodURI(ctx context.Context) (method installMethod, updateURI string, err error) { +func (c *Client) firmwareInstallMethodURI() (method installMethod, updateURI string, err error) { updateService, err := c.UpdateService() if err != nil { return "", "", errors.Wrap(bmclibErrs.ErrRedfishUpdateService, err.Error()) diff --git a/internal/redfishwrapper/firmware_test.go b/internal/redfishwrapper/firmware_test.go index 0929d0a7..5d8c7033 100644 --- a/internal/redfishwrapper/firmware_test.go +++ b/internal/redfishwrapper/firmware_test.go @@ -197,7 +197,7 @@ func TestFirmwareInstallMethodURI(t *testing.T) { t.Fatal(err) } - gotMethod, gotURI, err := client.firmwareInstallMethodURI(ctx) + gotMethod, gotURI, err := client.firmwareInstallMethodURI() if tc.err != nil { assert.ErrorContains(t, err, tc.err.Error()) return diff --git a/internal/redfishwrapper/inventory.go b/internal/redfishwrapper/inventory.go index 05046eb2..7d4076aa 100644 --- a/internal/redfishwrapper/inventory.go +++ b/internal/redfishwrapper/inventory.go @@ -90,13 +90,13 @@ func (c *Client) Inventory(ctx context.Context, failOnError bool) (device *commo } // populate device System components attributes - err = c.systemAttributes(ctx, device, failOnError, softwareInventory) + err = c.systemAttributes(device, failOnError, softwareInventory) if err != nil && failOnError { return nil, err } // populate device BMC component attributes - err = c.bmcAttributes(ctx, device, failOnError, softwareInventory) + err = c.bmcAttributes(ctx, device, softwareInventory) if err != nil && failOnError { return nil, err } @@ -107,7 +107,7 @@ func (c *Client) Inventory(ctx context.Context, failOnError bool) (device *commo // DeviceVendorModel returns the device vendor and model attributes // bmcAttributes collects BMC component attributes -func (c *Client) bmcAttributes(ctx context.Context, device *common.Device, failOnError bool, softwareInventory []*redfish.SoftwareInventory) (err error) { +func (c *Client) bmcAttributes(ctx context.Context, device *common.Device, softwareInventory []*redfish.SoftwareInventory) (err error) { managers, err := c.Managers(ctx) if err != nil { return err @@ -193,7 +193,7 @@ func (c *Client) chassisAttributes(ctx context.Context, device *common.Device, f } -func (c *Client) systemAttributes(ctx context.Context, device *common.Device, failOnError bool, softwareInventory []*redfish.SoftwareInventory) (err error) { +func (c *Client) systemAttributes(device *common.Device, failOnError bool, softwareInventory []*redfish.SoftwareInventory) (err error) { systems, err := c.Systems() if err != nil { return err