Skip to content

Commit

Permalink
Merge pull request #1148 from ioito/automated-cherry-pick-of-#1147-up…
Browse files Browse the repository at this point in the history
…stream-master

Automated cherry pick of #1147: fix(zstack): zstack auth url error
  • Loading branch information
ioito authored Dec 29, 2024
2 parents 7ddf05b + 9234f76 commit 7ae9257
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/multicloud/zstack/zstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/pkg/errors"
"yunion.io/x/pkg/gotypes"
"yunion.io/x/pkg/util/httputils"

api "yunion.io/x/cloudmux/pkg/apis/compute"
Expand Down Expand Up @@ -186,6 +187,9 @@ func (cli *SZStackClient) connect() error {
if err == nil {
return nil
}
if !strings.Contains(cli.authURL, "8080") {
return errors.Wrapf(err, "please set port to 8080, try again")
}
return errors.Wrapf(err, "connect")
}
return fmt.Errorf("password auth has been deprecated, please using ak sk auth")
Expand All @@ -199,6 +203,9 @@ func (cli *SZStackClient) listAll(resource string, params url.Values, retVal int
if err != nil {
return err
}
if gotypes.IsNil(resp) {
return errors.Wrapf(errors.ErrEmpty, "empty response")
}
objs, err := resp.GetArray("inventories")
if err != nil {
return err
Expand Down

0 comments on commit 7ae9257

Please sign in to comment.