fix: cloud account queued sync_status is overried as idle

This commit is contained in:
Qiu Jian
2019-04-15 23:30:14 +08:00
parent 39151ab2ab
commit 5e562dd2bb
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -1273,6 +1273,10 @@ func (self *SCloudaccount) StartCloudaccountDeleteTask(ctx context.Context, user
}
func (self *SCloudaccount) getSyncStatus() string {
if self.SyncStatus == api.CLOUD_PROVIDER_SYNC_STATUS_QUEUED {
return self.SyncStatus
}
cprs := CloudproviderRegionManager.Query().SubQuery()
providers := CloudproviderManager.Query().SubQuery()
+1 -1
View File
@@ -3192,7 +3192,7 @@ func (self *SHost) Attach2Network(ctx context.Context, userCred mcclient.TokenCr
return err
}
if len(ipAddr) > 0 && ipAddr != freeIp && requireDesignatedIp {
return fmt.Errorf("IP address %s is occupied", ipAddr)
return fmt.Errorf("IP address %s is occupied, get %s instead", ipAddr, freeIp)
}
bn := &SHostnetwork{}
bn.BaremetalId = self.Id