From b06be9ea5ca267abc658736ee4d4abf8011f9da9 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 23 Dec 2020 13:26:29 +0800 Subject: [PATCH] fix(mcclient): options: webconsole: fix passing ssh port --- pkg/mcclient/options/webconsole.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/mcclient/options/webconsole.go b/pkg/mcclient/options/webconsole.go index 89052fb5ac..bd06eb7092 100644 --- a/pkg/mcclient/options/webconsole.go +++ b/pkg/mcclient/options/webconsole.go @@ -71,12 +71,18 @@ func (opt *WebConsoleBaremetalOptions) Params() (*jsonutils.JSONDict, error) { type WebConsoleSshOptions struct { WebConsoleOptions - IP string `help:"IP to connect"` + IP string `help:"IP to connect" json:"-"` Port int `help:"Remote server port"` } func (opt *WebConsoleSshOptions) Params() (*jsonutils.JSONDict, error) { - return StructToParams(opt) + data, err := StructToParams(opt) + if err != nil { + return nil, err + } + params := jsonutils.NewDict() + params.Set("webconsole", data) + return params, nil } type WebConsoleServerOptions struct {