From 1b7acb4eeefd455317170e5bae120a28b2ccc3d9 Mon Sep 17 00:00:00 2001 From: TangBin Date: Thu, 9 Jan 2020 16:34:14 +0800 Subject: [PATCH] _getModule fix --- pkg/mcclient/modulebase/modules.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/mcclient/modulebase/modules.go b/pkg/mcclient/modulebase/modules.go index 5b604494f7..56e3017762 100644 --- a/pkg/mcclient/modulebase/modules.go +++ b/pkg/mcclient/modulebase/modules.go @@ -249,6 +249,11 @@ func _getModule(session *mcclient.ClientSession, name string) (BaseManagerInterf if !ok { return nil, fmt.Errorf("No such module %s for version %s", name, session.GetApiVersion()) } + + if len(mods) == 1 { + return mods[0], nil + } + for _, mod := range mods { url, e := session.GetServiceURL(mod.ServiceType(), mod.EndpointType()) if e != nil {