mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
get eip bugfix
This commit is contained in:
+16
-12
@@ -1038,13 +1038,15 @@ func (self *SDisk) StartDiskSaveTask(ctx context.Context, userCred mcclient.Toke
|
||||
|
||||
func (self *SDisk) ValidateDeleteCondition(ctx context.Context) error {
|
||||
provider := self.GetCloudprovider()
|
||||
if provider != nil && !provider.IsAvailable() {
|
||||
return httperrors.NewNotSufficientPrivilegeError("cloud provider %s is not available", provider.GetName())
|
||||
}
|
||||
if provider != nil {
|
||||
if !provider.IsAvailable() {
|
||||
return httperrors.NewNotSufficientPrivilegeError("cloud provider %s is not available", provider.GetName())
|
||||
}
|
||||
|
||||
account := provider.GetCloudaccount()
|
||||
if account != nil && !account.IsAvailable() {
|
||||
return httperrors.NewNotSufficientPrivilegeError("cloud account %s is not available", account.GetName())
|
||||
account := provider.GetCloudaccount()
|
||||
if account != nil && !account.IsAvailable() {
|
||||
return httperrors.NewNotSufficientPrivilegeError("cloud account %s is not available", account.GetName())
|
||||
}
|
||||
}
|
||||
|
||||
return self.validateDeleteCondition(ctx, false)
|
||||
@@ -1070,13 +1072,15 @@ func (self *SDisk) validateDeleteCondition(ctx context.Context, isPurge bool) er
|
||||
|
||||
func (self *SDisk) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool {
|
||||
provider := self.GetCloudprovider()
|
||||
if provider != nil && !provider.IsAvailable() {
|
||||
return false
|
||||
}
|
||||
if provider != nil {
|
||||
if !provider.IsAvailable() {
|
||||
return false
|
||||
}
|
||||
|
||||
account := provider.GetCloudaccount()
|
||||
if account != nil && !account.IsAvailable() {
|
||||
return false
|
||||
account := provider.GetCloudaccount()
|
||||
if account != nil && !account.IsAvailable() {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
overridePendingDelete := false
|
||||
|
||||
@@ -692,7 +692,7 @@ func (self *SLoadbalancer) DeleteEip(ctx context.Context, userCred mcclient.Toke
|
||||
}
|
||||
|
||||
func (self *SLoadbalancer) GetEip() (*SElasticip, error) {
|
||||
return ElasticipManager.getEipForInstance(api.EIP_ASSOCIATE_TYPE_LOADBALANCER, self.Id)
|
||||
return ElasticipManager.getEip(api.EIP_ASSOCIATE_TYPE_LOADBALANCER, self.Id, "")
|
||||
}
|
||||
|
||||
func (self *SLoadbalancer) SyncLoadbalancerEip(ctx context.Context, userCred mcclient.TokenCredential, provider *SCloudprovider, extEip cloudprovider.ICloudEIP) compare.SyncResult {
|
||||
|
||||
Reference in New Issue
Block a user