From ec432d1ee9f16e8be0ab9218cfd4bf7362065cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Wed, 17 Oct 2018 18:49:07 +0800 Subject: [PATCH] =?UTF-8?q?Azure=E7=A6=81=E6=AD=A2=E4=BD=BF=E7=94=A8root?= =?UTF-8?q?=E8=B4=A6=E6=88=B7=E7=99=BB=E5=BD=95=EF=BC=8C=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=9C=BA=E5=99=A8=E5=90=8E=E8=BF=94=E5=9B=9E=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D=EF=BC=8C=E9=81=BF=E5=85=8D=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/compute/guestdrivers/aliyun.go | 10 +++++----- pkg/compute/guestdrivers/azure.go | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/compute/guestdrivers/aliyun.go b/pkg/compute/guestdrivers/aliyun.go index d081599979..459edc090c 100644 --- a/pkg/compute/guestdrivers/aliyun.go +++ b/pkg/compute/guestdrivers/aliyun.go @@ -75,7 +75,7 @@ type SDiskInfo struct { Metadata map[string]string } -func fetchIVMinfo(desc SManagedVMCreateConfig, iVM cloudprovider.ICloudVM, guestId string, passwd string) *jsonutils.JSONDict { +func fetchIVMinfo(desc SManagedVMCreateConfig, iVM cloudprovider.ICloudVM, guestId string, account, passwd string) *jsonutils.JSONDict { data := jsonutils.NewDict() data.Add(jsonutils.NewString(iVM.GetOSType()), "os") @@ -85,7 +85,7 @@ func fetchIVMinfo(desc SManagedVMCreateConfig, iVM cloudprovider.ICloudVM, guest if err != nil { log.Errorf("encrypt password failed %s", err) } - data.Add(jsonutils.NewString("root"), "account") + data.Add(jsonutils.NewString(account), "account") data.Add(jsonutils.NewString(encpasswd), "key") } @@ -207,7 +207,7 @@ func (self *SAliyunGuestDriver) RequestDeployGuestOnHost(ctx context.Context, gu } }*/ - data := fetchIVMinfo(desc, iVM, guest.Id, passwd) + data := fetchIVMinfo(desc, iVM, guest.Id, "root", passwd) /* data.Add(jsonutils.NewString(iVM.GetOSType()), "os") @@ -287,7 +287,7 @@ func (self *SAliyunGuestDriver) RequestDeployGuestOnHost(ctx context.Context, gu return nil, err } - data := fetchIVMinfo(desc, iVM, guest.Id, passwd) + data := fetchIVMinfo(desc, iVM, guest.Id, "root", passwd) /* data := jsonutils.NewDict() @@ -354,7 +354,7 @@ func (self *SAliyunGuestDriver) RequestDeployGuestOnHost(ctx context.Context, gu } } - data := fetchIVMinfo(desc, iVM, guest.Id, passwd) + data := fetchIVMinfo(desc, iVM, guest.Id, "root", passwd) return data, nil }) diff --git a/pkg/compute/guestdrivers/azure.go b/pkg/compute/guestdrivers/azure.go index 90cfe6d6ba..10432b7192 100644 --- a/pkg/compute/guestdrivers/azure.go +++ b/pkg/compute/guestdrivers/azure.go @@ -110,7 +110,7 @@ func (self *SAzureGuestDriver) RequestDeployGuestOnHost(ctx context.Context, gue return nil, err } - data := fetchIVMinfo(desc, iVM, guest.Id, passwd) + data := fetchIVMinfo(desc, iVM, guest.Id, DEFAULT_USER, passwd) return data, nil } }) @@ -133,7 +133,7 @@ func (self *SAzureGuestDriver) RequestDeployGuestOnHost(ctx context.Context, gue if err != nil { return nil, err } - data := fetchIVMinfo(desc, iVM, guest.Id, passwd) + data := fetchIVMinfo(desc, iVM, guest.Id, DEFAULT_USER, passwd) return data, nil }) } else if action == "rebuild" { @@ -150,7 +150,7 @@ func (self *SAzureGuestDriver) RequestDeployGuestOnHost(ctx context.Context, gue } log.Debugf("VMrebuildRoot %s, and status is ready", iVM.GetGlobalId()) - data := fetchIVMinfo(desc, iVM, guest.Id, passwd) + data := fetchIVMinfo(desc, iVM, guest.Id, DEFAULT_USER, passwd) return data, nil })