mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix climc server-deploy (#243)
This commit is contained in:
committed by
yunion-ci-robot
parent
8498ad66a0
commit
bf0274779b
@@ -202,7 +202,7 @@ type ServerDeployInput struct {
|
||||
Id string
|
||||
|
||||
Keypair string `json:"keypair"`
|
||||
DeleteKeypair bool `json:"__delete_keypair__"`
|
||||
DeleteKeypair *bool `json:"__delete_keypair__"`
|
||||
DeployConfigs []*DeployConfig `json:"deploy_configs"`
|
||||
ResetPassword *bool `json:"reset_password"`
|
||||
Password string `json:"password"`
|
||||
|
||||
@@ -443,12 +443,17 @@ type ServerDeployOptions struct {
|
||||
func (opts *ServerDeployOptions) Params() (*computeapi.ServerDeployInput, error) {
|
||||
params := new(computeapi.ServerDeployInput)
|
||||
{
|
||||
deleteKeyPair := BoolV(opts.DeleteKeypair)
|
||||
if deleteKeyPair {
|
||||
params.DeleteKeypair = true
|
||||
if opts.DeleteKeypair != nil {
|
||||
params.DeleteKeypair = opts.DeleteKeypair
|
||||
} else if len(opts.Keypair) > 0 {
|
||||
params.Keypair = opts.Keypair
|
||||
}
|
||||
params.AutoStart = opts.AutoStart
|
||||
if opts.ResetPassword != nil {
|
||||
params.ResetPassword = opts.ResetPassword
|
||||
} else if len(opts.Password) > 0 {
|
||||
params.Password = opts.Password
|
||||
}
|
||||
}
|
||||
{
|
||||
deployInfos, err := ParseServerDeployInfoList(opts.Deploy)
|
||||
|
||||
Reference in New Issue
Block a user