_getModule fix

This commit is contained in:
TangBin
2020-01-09 16:34:14 +08:00
parent 7c31d1a7da
commit 1b7acb4eee
+5
View File
@@ -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 {