mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
fix: disabling cloud account should not turn off auto sync switch
This commit is contained in:
@@ -216,12 +216,12 @@ func (self *SCloudaccount) PerformDisable(ctx context.Context, userCred mcclient
|
||||
}
|
||||
}
|
||||
}
|
||||
if self.EnableAutoSync {
|
||||
/*if self.EnableAutoSync {
|
||||
err := self.disableAutoSync(ctx, userCred)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}*/
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ func (self *SCloudproviderregion) getExtraDetails(extra *jsonutils.JSONDict) *js
|
||||
extra.Add(jsonutils.NewString(account.Id), "cloudaccount_id")
|
||||
extra.Add(jsonutils.NewString(account.Name), "cloudaccount")
|
||||
extra.Add(jsonutils.NewString(account.DomainId), "cloudaccount_domain_id")
|
||||
if account.EnableAutoSync {
|
||||
if account.Enabled && account.EnableAutoSync {
|
||||
extra.Add(jsonutils.JSONTrue, "enable_auto_sync")
|
||||
} else {
|
||||
extra.Add(jsonutils.JSONFalse, "enable_auto_sync")
|
||||
|
||||
@@ -499,6 +499,9 @@ func (self *SCloudprovider) PerformSync(ctx context.Context, userCred mcclient.T
|
||||
return nil, httperrors.NewInvalidStatusError("Cloudprovider disabled")
|
||||
}
|
||||
account := self.GetCloudaccount()
|
||||
if !account.Enabled {
|
||||
return nil, httperrors.NewInvalidStatusError("Cloudaccount disabled")
|
||||
}
|
||||
if account.EnableAutoSync {
|
||||
return nil, httperrors.NewInvalidStatusError("Account auto sync enabled")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user