From 4f839a5b61ce9405d77590be8b6f501ddcb76d24 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Thu, 5 Oct 2023 13:57:52 -0600 Subject: [PATCH] Fixed some minor issues --- cmd/update.go | 3 ++- internal/update.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/update.go b/cmd/update.go index b2b854a..0df2916 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -30,6 +30,7 @@ var updateCmd = &cobra.Command{ QueryParams: magellan.QueryParams{ Drivers: []string{"redfish"}, Preferred: "redfish", + Protocol: protocol, Host: host, User: user, Pass: pass, @@ -70,7 +71,7 @@ func init() { updateCmd.Flags().IntVar(&port, "port", 443, "set the BMC port") updateCmd.Flags().StringVar(&user, "user", "", "set the BMC user") updateCmd.Flags().StringVar(&pass, "pass", "", "set the BMC password") - updateCmd.Flags().StringVar(&transferProtocol, "protocol", "HTTP", "set the transfer protocol") + updateCmd.Flags().StringVar(&transferProtocol, "transfer-protocol", "HTTP", "set the transfer protocol") updateCmd.Flags().StringVar(&protocol, "protocol", "https", "set the Redfish protocol") updateCmd.Flags().StringVar(&firmwarePath, "firmware-path", "", "set the path to the firmware") updateCmd.Flags().StringVar(&firmwareVersion, "firmware-version", "", "set the version of firmware to be installed") diff --git a/internal/update.go b/internal/update.go index 7881449..fbfc52e 100644 --- a/internal/update.go +++ b/internal/update.go @@ -126,7 +126,7 @@ func UpdateFirmware(client *bmclib.Client, l *log.Logger, q *UpdateParams) error } func UpdateFirmwareRemote(q *UpdateParams) error { - url := baseRedfishUrl(&q.QueryParams) + "/UpdateService/Actions/SimpleUpdate" + url := baseRedfishUrl(&q.QueryParams) + "/redfish/v1/UpdateService/Actions/SimpleUpdate" headers := map[string]string { "Content-Type": "application/json", "cache-control": "no-cache", @@ -153,7 +153,7 @@ func UpdateFirmwareRemote(q *UpdateParams) error { } func GetUpdateStatus(q *UpdateParams) error { - url := baseRedfishUrl(&q.QueryParams) + "/UpdateService" + url := baseRedfishUrl(&q.QueryParams) + "/redfish/v1/UpdateService" res, body, err := util.MakeRequest(url, "GET", nil, nil) if err != nil { return fmt.Errorf("something went wrong: %v", err)