Manual follow-on tweaks to get the build green again.
diff --git a/openstack/utils/choose_version.go b/openstack/utils/choose_version.go
index 52f37a9..b697ba8 100644
--- a/openstack/utils/choose_version.go
+++ b/openstack/utils/choose_version.go
@@ -23,7 +23,7 @@
// ChooseVersion queries the base endpoint of an API to choose the most recent non-experimental alternative from a service's
// published versions.
// It returns the highest-Priority Version among the alternatives that are provided, as well as its corresponding endpoint.
-func ChooseVersion(identityBase string, identityEndpoint string, recognized []*Version) (*Version, string, error) {
+func ChooseVersion(client *gophercloud.ProviderClient, recognized []*Version) (*Version, string, error) {
type linkResp struct {
Href string `json:"href"`
Rel string `json:"rel"`
@@ -49,7 +49,7 @@
}
return endpoint
}
- identityEndpoint = normalize(identityEndpoint)
+ identityEndpoint := normalize(client.IdentityEndpoint)
// If a full endpoint is specified, check version suffixes for a match first.
for _, v := range recognized {
@@ -59,7 +59,7 @@
}
var resp response
- _, err := client.Request("GET", identityBase, gophercloud.RequestOpts{
+ _, err := client.Request("GET", client.IdentityBase, gophercloud.RequestOpts{
JSONResponse: &resp,
OkCodes: []int{200, 300},
})
@@ -88,7 +88,7 @@
// Prefer a version that exactly matches the provided endpoint.
if href == identityEndpoint {
if href == "" {
- return nil, "", fmt.Errorf("Endpoint missing in version %s response from %s", value.ID, identityBase)
+ return nil, "", fmt.Errorf("Endpoint missing in version %s response from %s", value.ID, client.IdentityBase)
}
return matching, href, nil
}
@@ -104,10 +104,10 @@
}
if highest == nil {
- return nil, "", fmt.Errorf("No supported version available from endpoint %s", identityBase)
+ return nil, "", fmt.Errorf("No supported version available from endpoint %s", client.IdentityBase)
}
if endpoint == "" {
- return nil, "", fmt.Errorf("Endpoint missing in version %s response from %s", highest.ID, identityBase)
+ return nil, "", fmt.Errorf("Endpoint missing in version %s response from %s", highest.ID, client.IdentityBase)
}
return highest, endpoint, nil