diff --git a/cmd/climc/shell/webconsole.go b/cmd/climc/shell/webconsole.go index e8d4a26d9f..928e9ea8d0 100644 --- a/cmd/climc/shell/webconsole.go +++ b/cmd/climc/shell/webconsole.go @@ -58,7 +58,7 @@ func init() { }) R(&o.WebConsoleBaremetalOptions{}, "webconsole-baremetal", "Connect baremetal host webconsole", func(s *mcclient.ClientSession, args *o.WebConsoleBaremetalOptions) error { - ret, err := modules.WebConsole.DoBaremetalConnect(s, args.ID) + ret, err := modules.WebConsole.DoBaremetalConnect(s, args.ID, nil) if err != nil { return err } @@ -67,7 +67,7 @@ func init() { }) R(&o.WebConsoleSshOptions{}, "webconsole-ssh", "Connect ssh webconsole", func(s *mcclient.ClientSession, args *o.WebConsoleSshOptions) error { - ret, err := modules.WebConsole.DoSshConnect(s, args.IP) + ret, err := modules.WebConsole.DoSshConnect(s, args.IP, nil) if err != nil { return err } diff --git a/pkg/mcclient/modules/mod_webconsole.go b/pkg/mcclient/modules/mod_webconsole.go index 963240028d..509de4c575 100644 --- a/pkg/mcclient/modules/mod_webconsole.go +++ b/pkg/mcclient/modules/mod_webconsole.go @@ -26,11 +26,7 @@ func NewWebConsoleManager() ResourceManager { Keyword: "webconsole", KeywordPlural: "webconsole"} } -func (m WebConsoleManager) DoConnect( - s *mcclient.ClientSession, - connType, id, action string, - params jsonutils.JSONObject, -) (jsonutils.JSONObject, error) { +func (m WebConsoleManager) DoConnect(s *mcclient.ClientSession, connType, id, action string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) { if len(connType) == 0 { return nil, fmt.Errorf("Empty connection resource type") } @@ -44,32 +40,22 @@ func (m WebConsoleManager) DoConnect( return m._post(s, url, params, "webconsole") } -func (m WebConsoleManager) DoK8sConnect( - s *mcclient.ClientSession, - id, action string, - params jsonutils.JSONObject, -) (jsonutils.JSONObject, error) { +func (m WebConsoleManager) DoK8sConnect(s *mcclient.ClientSession, id, action string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) { return m.DoConnect(s, "k8s", id, action, params) } -func (m WebConsoleManager) DoK8sShellConnect( - s *mcclient.ClientSession, - id string, params jsonutils.JSONObject, -) (jsonutils.JSONObject, error) { +func (m WebConsoleManager) DoK8sShellConnect(s *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) { return m.DoK8sConnect(s, id, "shell", params) } -func (m WebConsoleManager) DoK8sLogConnect( - s *mcclient.ClientSession, - id string, params jsonutils.JSONObject, -) (jsonutils.JSONObject, error) { +func (m WebConsoleManager) DoK8sLogConnect(s *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) { return m.DoK8sConnect(s, id, "log", params) } -func (m WebConsoleManager) DoBaremetalConnect(s *mcclient.ClientSession, id string) (jsonutils.JSONObject, error) { +func (m WebConsoleManager) DoBaremetalConnect(s *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) { return m.DoConnect(s, "baremetal", id, "", nil) } -func (m WebConsoleManager) DoSshConnect(s *mcclient.ClientSession, id string) (jsonutils.JSONObject, error) { +func (m WebConsoleManager) DoSshConnect(s *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) { return m.DoConnect(s, "ssh", id, "", nil) }