修改超售比后立即刷新调度缓存

This commit is contained in:
屈轩
2019-02-16 17:31:05 +08:00
parent 6528992b5b
commit 423ef544e2
+13
View File
@@ -137,6 +137,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)
}