openstack object storage v02.0
diff --git a/acceptance/openstack/tools_test.go b/acceptance/openstack/tools_test.go
index c9a004f..d27ab0a 100644
--- a/acceptance/openstack/tools_test.go
+++ b/acceptance/openstack/tools_test.go
@@ -33,7 +33,7 @@
alternateName string
}
-func setupForList() (*testState, error) {
+func setupForList(service string) (*testState, error) {
var err error
ts := new(testState)
@@ -53,7 +53,7 @@
return ts, err
}
- ts.eps, err = findAllComputeEndpoints(ts.sc)
+ ts.eps, err = findAllEndpoints(ts.sc, service)
if err != nil {
return ts, err
}
@@ -65,7 +65,7 @@
}
func setupForCRUD() (*testState, error) {
- ts, err := setupForList()
+ ts, err := setupForList("compute")
if err != nil {
return ts, err
}
@@ -93,19 +93,19 @@
return ts, err
}
-func findAllComputeEndpoints(sc *identity.ServiceCatalog) ([]identity.Endpoint, error) {
+func findAllEndpoints(sc *identity.ServiceCatalog, service string) ([]identity.Endpoint, error) {
ces, err := sc.CatalogEntries()
if err != nil {
return nil, err
}
for _, ce := range ces {
- if ce.Type == "compute" {
+ if ce.Type == service {
return ce.Endpoints, nil
}
}
- return nil, fmt.Errorf("Compute endpoint not found.")
+ return nil, fmt.Errorf(service + " endpoint not found.")
}
func findEndpointForRegion(eps []identity.Endpoint, r string) (string, error) {