fix(region): update rescuing status to rescue (#19543)

This commit is contained in:
wanyaoqi
2024-02-24 07:53:56 +08:00
committed by GitHub
parent e62b5c1fc2
commit 629c9982ab
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ const (
VM_UNSYNC = "unsync"
VM_START_RESCUE = "start_rescue"
VM_RESCUING = "rescuing"
VM_RESCUE = "rescue"
VM_STOP_RESCUE = "stop_rescue"
VM_START_RESCUE_FAILED = "start_rescue_failed"
VM_STOP_RESCUE_FAILED = "stop_rescue_failed"
+2 -2
View File
@@ -112,7 +112,7 @@ func (self *StartRescueTask) OnRescueStartServerComplete(ctx context.Context, gu
logclient.AddActionLogWithStartable(self, guest, logclient.ACT_VM_START_RESCUE, guest.GetShortDesc(ctx), self.UserCred, true)
// Set guest status to rescue running
guest.SetStatus(ctx, self.UserCred, api.VM_RESCUING, "OnRescueStartServerComplete")
guest.SetStatus(ctx, self.UserCred, api.VM_RESCUE, "OnRescueStartServerComplete")
self.SetStageComplete(ctx, nil)
}
@@ -135,7 +135,7 @@ func (self *StopRescueTask) OnInit(ctx context.Context, obj db.IStandaloneModel,
// Flow: stop -> modify startvm script for rescue -> start
guest := obj.(*models.SGuest)
// Check if guest is running
if guest.Status == api.VM_RUNNING || guest.Status == api.VM_RESCUING {
if guest.Status == api.VM_RUNNING || guest.Status == api.VM_RESCUE {
self.StopServer(ctx, guest)
} else {
self.ClearRescue(ctx, guest)