From 5a272fd3303b19c719de178ff92f183dae1372e2 Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Thu, 11 Jul 2019 12:01:57 +0800 Subject: [PATCH] fix: task usercred should be utf8 charset --- pkg/cloudcommon/db/taskman/tasks.go | 4 ++-- pkg/logger/models/actionlog.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cloudcommon/db/taskman/tasks.go b/pkg/cloudcommon/db/taskman/tasks.go index bcf4fb06e2..a49c63cb41 100644 --- a/pkg/cloudcommon/db/taskman/tasks.go +++ b/pkg/cloudcommon/db/taskman/tasks.go @@ -80,9 +80,9 @@ type STask struct { ObjName string `width:"128" charset:"utf8" nullable:"false" list:"user"` // Column(VARCHAR(128, charset='utf8'), nullable=False) ObjId string `width:"128" charset:"ascii" nullable:"false" list:"user" index:"true"` // Column(VARCHAR(ID_LENGTH, charset='ascii'), nullable=False) TaskName string `width:"64" charset:"ascii" nullable:"false" list:"user"` // Column(VARCHAR(64, charset='ascii'), nullable=False) - UserCred mcclient.TokenCredential `width:"1024" charset:"ascii" nullable:"false" get:"user"` // Column(VARCHAR(1024, charset='ascii'), nullable=False) + UserCred mcclient.TokenCredential `width:"1024" charset:"utf8" nullable:"false" get:"user"` // Column(VARCHAR(1024, charset='ascii'), nullable=False) // OwnerCred string `width:"512" charset:"ascii" nullable:"true"` // Column(VARCHAR(512, charset='ascii'), nullable=True) - Params *jsonutils.JSONDict `charset:"ascii" length:"medium" nullable:"false" get:"user"` // Column(MEDIUMTEXT(charset='ascii'), nullable=False) + Params *jsonutils.JSONDict `charset:"utf8" length:"medium" nullable:"false" get:"user"` // Column(MEDIUMTEXT(charset='ascii'), nullable=False) Stage string `width:"64" charset:"ascii" nullable:"false" default:"on_init" list:"user"` // Column(VARCHAR(64, charset='ascii'), nullable=False, default='on_init') diff --git a/pkg/logger/models/actionlog.go b/pkg/logger/models/actionlog.go index 6bdf958574..545d215665 100644 --- a/pkg/logger/models/actionlog.go +++ b/pkg/logger/models/actionlog.go @@ -67,7 +67,7 @@ func (action *SActionlog) CustomizeCreate(ctx context.Context, userCred mcclient if action.StartTime.IsZero() { action.StartTime = now } - return nil + return action.SOpsLog.CustomizeCreate(ctx, userCred, ownerId, query, data) } // Websockets 不再拉取 ActionLog 的消息,因此注释掉如下代码