Skip to content

Commit

Permalink
Clean up unused parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
splaspood committed Apr 12, 2024
1 parent 6d2a8b4 commit 21c67a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions internal/redfishwrapper/firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand All @@ -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())
}
Expand Down Expand Up @@ -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")
}
Expand All @@ -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")
}
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion internal/redfishwrapper/firmware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions internal/redfishwrapper/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 21c67a7

Please sign in to comment.