mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): skip set lost name when purge deleted vm (#19752)
This commit is contained in:
@@ -2974,13 +2974,6 @@ func (self *SGuest) SyncRemoveCloudVM(ctx context.Context, userCred mcclient.Tok
|
||||
}
|
||||
}
|
||||
|
||||
if !lostNamePattern.MatchString(self.Name) {
|
||||
db.Update(self, func() error {
|
||||
self.Name = fmt.Sprintf("%s-lost@%s", self.Name, timeutils.ShortDate(time.Now()))
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
if self.Status != api.VM_UNKNOWN {
|
||||
self.SetStatus(ctx, userCred, api.VM_UNKNOWN, "Sync lost")
|
||||
}
|
||||
@@ -2995,6 +2988,15 @@ func (self *SGuest) SyncRemoveCloudVM(ctx context.Context, userCred mcclient.Tok
|
||||
Obj: self,
|
||||
Action: notifyclient.ActionSyncDelete,
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
if !lostNamePattern.MatchString(self.Name) {
|
||||
db.Update(self, func() error {
|
||||
self.Name = fmt.Sprintf("%s-lost@%s", self.Name, timeutils.ShortDate(time.Now()))
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user