Automatic merge from release/2.5.0 -> release/2.6.0

* commit 'f8669e5844024e23a665c207be18806d5d6e639d':
  修改超售比后立即刷新调度缓存
This commit is contained in:
邱剑
2019-02-16 22:21:28 +08:00
+13
View File
@@ -158,6 +158,19 @@ func (self *SStorage) AllowUpdateItem(ctx context.Context, userCred mcclient.Tok
return db.IsAdminAllowUpdate(userCred, self)
}
func (self *SStorage) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) {
self.SEnabledStatusStandaloneResourceBase.PostUpdate(ctx, userCred, query, data)
if data.Contains("cmtbound") {
hosts := self.GetAttachedHosts()
for _, host := range hosts {
if err := host.ClearSchedDescCache(); err != nil {
log.Errorf("clear host %s sched cache failed %v", host.GetName(), err)
}
}
}
}
func (self *SStorage) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool {
return db.IsAdminAllowDelete(userCred, self)
}