mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #914 in YUNIONIO/onecloud from ~LIZEXI/onecloud:hotfix/lzx-isodev-purge to release/2.4.0
* commit '9eca0250ae6f28a66eec9058c75258bb7407c9b4': region: isolated_devices purge action
This commit is contained in:
@@ -530,6 +530,14 @@ func (self *SIsolatedDevice) RealDelete(ctx context.Context, userCred mcclient.T
|
||||
return self.ClearSchedDescCache()
|
||||
}
|
||||
|
||||
func (self *SIsolatedDevice) AllowPerformPurge(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool {
|
||||
return db.IsAdminAllowPerform(userCred, self, "purge")
|
||||
}
|
||||
|
||||
func (self *SIsolatedDevice) PerformPurge(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
||||
return nil, self.CustomizeDelete(ctx, userCred, query, data)
|
||||
}
|
||||
|
||||
func (self *SIsolatedDevice) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error {
|
||||
if len(self.GuestId) > 0 {
|
||||
if !jsonutils.QueryBoolean(data, "purge", false) {
|
||||
|
||||
Reference in New Issue
Block a user