Automatic merge from release/2.2.0 -> release/2.3.0

* commit 'c61f18d88e9a967f6c780456d4ae635bb94d9485':
  fmt
  onecloud 增加重启的 actionlog
This commit is contained in:
张东亮
2018-10-16 18:11:49 +08:00
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -4,10 +4,10 @@ import (
"context"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/cloudcommon/db"
"yunion.io/x/onecloud/pkg/cloudcommon/db/taskman"
"yunion.io/x/onecloud/pkg/compute/models"
"yunion.io/x/onecloud/pkg/util/logclient"
)
func init() {
@@ -43,6 +43,7 @@ func (self *GuestHardResetTask) StopServer(ctx context.Context, guest *models.SG
guest.SetStatus(self.UserCred, models.VM_STOPPING, "")
self.SetStage("OnServerStopComplete", nil)
guest.StartGuestStopTask(ctx, self.UserCred, false, self.GetTaskId())
logclient.AddActionLog(guest, logclient.ACT_VM_RESTART, `{"is_force": true}`, self.UserCred, true)
}
func (self *GuestHardResetTask) OnServerStopComplete(ctx context.Context, guest *models.SGuest, data jsonutils.JSONObject) {
@@ -67,4 +68,5 @@ func (self *GuestRestartTask) StopServer(ctx context.Context, guest *models.SGue
self.SetStage("OnServerStopComplete", nil)
isForce := jsonutils.QueryBoolean(self.Params, "is_force", false)
guest.StartGuestStopTask(ctx, self.UserCred, isForce, self.GetTaskId())
logclient.AddActionLog(guest, logclient.ACT_VM_RESTART, `{"is_force": false}`, self.UserCred, true)
}
+1
View File
@@ -50,6 +50,7 @@ const (
ACT_VM_RESET_PSWD = "重置密码"
ACT_VM_START = "开机"
ACT_VM_STOP = "关机"
ACT_VM_RESTART = "重启"
ACT_VM_SYNC_CONF = "同步配置"
ACT_VM_SYNC_STATUS = "同步状态"
ACT_VM_UNBIND_KEYPAIR = "解绑密钥"