Merge pull request #16213 from swordqiu/automated-cherry-pick-of-#16212-upstream-release-3.10

Automated cherry pick of #16212: fix: minor fixes 20230313
This commit is contained in:
Zexi Li
2023-03-13 14:54:16 +08:00
committed by GitHub
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -437,5 +437,5 @@ func FetchNotifyAdminRecipients(ctx context.Context, region string, users []stri
func NotifyVmIntegrity(ctx context.Context, name string) {
data := jsonutils.NewDict()
data.Add(jsonutils.NewString(name), "name")
SystemExceptionNotifyWithResult(ctx, api.ActionChecksumTest, api.TOPIC_RESOURCE_DB_TABLE_RECORD, api.ResultFailed, data)
SystemExceptionNotifyWithResult(ctx, api.ActionChecksumTest, api.TOPIC_RESOURCE_VM_INTEGRITY_CHECK, api.ResultFailed, data)
}
+4 -1
View File
@@ -29,7 +29,10 @@ func ZeroFile(filename string) error {
if err != nil {
return errors.Wrap(err, "os.OpenFile")
}
defer f.Close()
defer func() {
f.Sync()
f.Close()
}()
info, err := f.Stat()
if err != nil {