Automatic merge from release/2.4.0 -> release/2.5.0

* commit '40eb0119ceef64af5671c771bdb9b90cd66f4dfa':
  region: isolated_devices purge action
This commit is contained in:
李泽玺
2019-01-10 15:59:59 +08:00
+8
View File
@@ -547,6 +547,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) {