mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #2124 from ioito/hotfix/qx-zstack-ak-sk
hotfix: deprecated password auth
This commit is contained in:
@@ -169,7 +169,10 @@ func (host *SHost) Refresh() error {
|
||||
}
|
||||
|
||||
func (host *SHost) GetHostStatus() string {
|
||||
return api.HOST_ONLINE
|
||||
if host.Status == "Connected" {
|
||||
return api.HOST_ONLINE
|
||||
}
|
||||
return api.HOST_OFFLINE
|
||||
}
|
||||
|
||||
func (host *SHost) GetEnabled() bool {
|
||||
|
||||
@@ -130,7 +130,7 @@ func (self *SStoragecache) uploadImage(ctx context.Context, userCred mcclient.To
|
||||
return "", err
|
||||
}
|
||||
img.storageCache = self
|
||||
err = cloudprovider.WaitStatus(img, api.CACHED_IMAGE_STATUS_READY, time.Second*5, time.Minute*10) //windows镜像转换比较慢,等待时间稍微设长一些
|
||||
err = cloudprovider.WaitStatus(img, api.CACHED_IMAGE_STATUS_READY, time.Second*5, time.Minute*20) //windows镜像转换比较慢,等待时间稍微设长一些
|
||||
if err != nil {
|
||||
log.Errorf("waitting for image %s(%s) status ready timeout", img.Name, img.UUID)
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ func (cli *SZStackClient) connect() error {
|
||||
"password": fmt.Sprintf("%x", sha512.Sum512([]byte(cli.password))),
|
||||
},
|
||||
})
|
||||
_, resp, err := httputils.JSONRequest(client, context.Background(), "PUT", authURL, header, body, cli.debug)
|
||||
_, _, err := httputils.JSONRequest(client, context.Background(), "PUT", authURL, header, body, cli.debug)
|
||||
if err != nil {
|
||||
err = cli.testAccessKey()
|
||||
if err == nil {
|
||||
@@ -150,8 +150,7 @@ func (cli *SZStackClient) connect() error {
|
||||
}
|
||||
return errors.Wrapf(err, "connect")
|
||||
}
|
||||
cli.sessionID, err = resp.GetString("inventory", "uuid")
|
||||
return err
|
||||
return fmt.Errorf("password auth has been deprecated, please using ak sk auth")
|
||||
}
|
||||
|
||||
func (cli *SZStackClient) listAll(resource string, params []string, retVal interface{}) error {
|
||||
|
||||
Reference in New Issue
Block a user