From 3745065611961af321641647eb95d61d7aeed0e1 Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Wed, 9 Jan 2019 00:24:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=9A1.=20vmware=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=AE=BF=E4=B8=BB=E6=9C=BA=E5=87=BA=E9=94=99=E5=90=8E?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E5=B0=BD=E5=8A=9B=E8=80=8C=E4=B8=BA=E5=9C=B0?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=89=80=E6=9C=89=E8=83=BD=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E7=9A=84=E6=9C=BA=E5=99=A8=202.=20=E4=BF=9D=E5=AD=98=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E6=97=B6=EF=BC=8C=E5=A6=82=E6=9E=9C=E7=BC=BA=E5=B0=91?= =?UTF-8?q?osType=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/compute/models/guest_actions.go | 6 +++++- .../tasks/cloud_provider_sync_onpremise_info_task.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/compute/models/guest_actions.go b/pkg/compute/models/guest_actions.go index 05abf42cb9..111b77d2a7 100644 --- a/pkg/compute/models/guest_actions.go +++ b/pkg/compute/models/guest_actions.go @@ -104,7 +104,11 @@ func (self *SGuest) PerformSaveImage(ctx context.Context, userCred mcclient.Toke if notes, err := data.GetString("notes"); err != nil && len(notes) > 0 { properties.Add(jsonutils.NewString(notes), "notes") } - properties.Add(jsonutils.NewString(self.OsType), "os_type") + osType := self.OsType + if len(osType) == 0 { + osType = "Linux" + } + properties.Add(jsonutils.NewString(osType), "os_type") kwargs.Add(properties, "properties") kwargs.Add(jsonutils.NewBool(restart), "restart") diff --git a/pkg/compute/tasks/cloud_provider_sync_onpremise_info_task.go b/pkg/compute/tasks/cloud_provider_sync_onpremise_info_task.go index ceb15a3f7c..6c6761db62 100644 --- a/pkg/compute/tasks/cloud_provider_sync_onpremise_info_task.go +++ b/pkg/compute/tasks/cloud_provider_sync_onpremise_info_task.go @@ -36,7 +36,7 @@ func syncOnPremiseCloudProviderInfo(ctx context.Context, provider *models.SCloud log.Infof(notes) if result.IsError() { logSyncFailed(provider, task, msg) - return + // return } db.OpsLog.LogEvent(provider, db.ACT_SYNC_HOST_COMPLETE, msg, task.UserCred) logclient.AddActionLog(provider, getAction(task.Params), notes, task.UserCred, true)