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

[BUG] in command update the variable "host" is not assigned. #68

Open
desnudaenlaplaya opened this issue Jan 30, 2025 · 2 comments
Open
Labels
bug Something isn't working

Comments

@desnudaenlaplaya
Copy link

Describe the bug

The variable "host" is not assigned.

In https://github.com/OpenCHAMI/magellan/blob/main/cmd/update.go#L67

To Reproduce
Steps to reproduce the behavior:

  1. just call the update command and the empty url is raised:
    $ ./magellan update https://:443
    --username root --password 0penBmc
    --firmware-url http://127.0.0.1:1337/obmc-phosphor-image-.static.mtd.tar
    --component BMC
    {"level":"error","error":"failed to parse URI: parse "": empty url","time":"2025-01-29T17:25:35+01:00","message":"failed to update firmware"}

Expected behavior
Just work if is valid

Fix

$ git diff cmd/update.go
@@ -57,6 +58,9 @@ var updateCmd = &cobra.Command{
                                return
                        }
+                       host = arg
                        // initiate a remote update
                        err := magellan.UpdateFirmwareRemote(&magellan.UpdateParams{
                                FirmwarePath:     firmwareUrl,
@desnudaenlaplaya desnudaenlaplaya added the bug Something isn't working label Jan 30, 2025
@davidallendj
Copy link
Collaborator

davidallendj commented Jan 30, 2025

Does this still work correctly when changing this line to URL: arg instead?
https://github.com/OpenCHAMI/magellan/blob/main/cmd/update.go#L67

I think that line was supposed to be similar to the one above on line 48:
https://github.com/OpenCHAMI/magellan/blob/main/cmd/update.go#L48

@alexlovelltroy
Copy link
Member

alexlovelltroy commented Feb 5, 2025

Looks like there's a fix in the linked branch. Do we have a test to validate that? I'd love to get that closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants