Merge pull request #2124 from ioito/hotfix/qx-zstack-ak-sk

hotfix: deprecated password auth
This commit is contained in:
yunion-ci-robot
2019-08-06 23:06:09 +08:00
committed by GitHub
3 changed files with 7 additions and 5 deletions
+4 -1
View File
@@ -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 {
+1 -1
View File
@@ -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)
}
+2 -3
View File
@@ -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 {