Merge pull request #15272 from wanyaoqi/fix/host-offline

fix(region): panic on host offline and update health status is nil
This commit is contained in:
Zexi Li
2022-11-03 15:21:13 +08:00
committed by GitHub
-1
View File
@@ -3973,7 +3973,6 @@ func (self *SHost) StartSyncstatus(ctx context.Context, userCred mcclient.TokenC
}
func (self *SHost) PerformOffline(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input *api.HostOfflineInput) (jsonutils.JSONObject, error) {
log.Errorf("input %v", *input.UpdateHealthStatus)
if self.HostStatus != api.HOST_OFFLINE {
_, err := self.SaveUpdates(func() error {
self.HostStatus = api.HOST_OFFLINE