mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
bugfix
This commit is contained in:
@@ -155,7 +155,7 @@ func (self *SHost) GetInstanceById(instanceId string) (*SInstance, error) {
|
||||
|
||||
func (self *SHost) CreateVM(name, imgId string, sysDiskSize, cpu, memMB int, networkId, ipAddr, desc,
|
||||
passwd, storageType string, diskSizes []int, publicKey string, secgroupId string, userData string) (cloudprovider.ICloudVM, error) {
|
||||
if len(publicKey) < 0 {
|
||||
if len(publicKey) == 0 {
|
||||
return nil, fmt.Errorf("AWS instance create error: keypair required")
|
||||
}
|
||||
|
||||
|
||||
@@ -620,13 +620,13 @@ func (self *SRegion) GetInstanceStatus(instanceId string) (string, error) {
|
||||
}
|
||||
|
||||
func (self *SRegion) instanceStatusChecking(instanceId, status string) error {
|
||||
status, err := self.GetInstanceStatus(instanceId)
|
||||
remoteStatus, err := self.GetInstanceStatus(instanceId)
|
||||
if err != nil {
|
||||
log.Errorf("Fail to get instance status on StartVM: %s", err)
|
||||
return err
|
||||
}
|
||||
if status != status {
|
||||
log.Errorf("StartVM: vm status is %s expect %s", status, status)
|
||||
if status != remoteStatus {
|
||||
log.Errorf("StartVM: vm status is %s expect %s", remoteStatus, status)
|
||||
return cloudprovider.ErrInvalidStatus
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user