From db0d989fc83c9c28957ee6b965e8d5f70a0fe0a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Tue, 4 Dec 2018 20:48:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=AF=86=E7=A0=81=E6=97=B6?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E6=9C=BA=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/compute/models/guest_actions.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/compute/models/guest_actions.go b/pkg/compute/models/guest_actions.go index daecd7b09f..820658c7e0 100644 --- a/pkg/compute/models/guest_actions.go +++ b/pkg/compute/models/guest_actions.go @@ -291,10 +291,7 @@ func (self *SGuest) PerformDeploy(ctx context.Context, userCred mcclient.TokenCr return nil, fmt.Errorf("Parse query body error") } - // 变更密码/密钥时需要Restart才能生效。更新普通字段不需要Restart, Azure需要在运行状态下操作 - doRestart := false if kwargs.Contains("__delete_keypair__") || kwargs.Contains("keypair") { - doRestart = self.GetDriver().IsNeedRestartForResetLoginInfo() var kpId string if kwargs.Contains("keypair") { @@ -325,6 +322,12 @@ func (self *SGuest) PerformDeploy(ctx context.Context, userCred mcclient.TokenCr } } + // 变更密码/密钥时需要Restart才能生效。更新普通字段不需要Restart, Azure需要在运行状态下操作 + doRestart := false + if resetPasswd, _ := kwargs.Bool("reset_password"); resetPasswd { + doRestart = self.GetDriver().IsNeedRestartForResetLoginInfo() + } + deployStatus, err := self.GetDriver().GetDeployStatus() if err != nil { return nil, httperrors.NewInputParameterError(err.Error())