Fix for issue#533
diff --git a/openstack/blockstorage/v1/apiversions/urls.go b/openstack/blockstorage/v1/apiversions/urls.go
index 56f8260..78f9645 100644
--- a/openstack/blockstorage/v1/apiversions/urls.go
+++ b/openstack/blockstorage/v1/apiversions/urls.go
@@ -2,6 +2,7 @@
import (
"strings"
+ "net/url"
"github.com/rackspace/gophercloud"
)
@@ -11,5 +12,7 @@
}
func listURL(c *gophercloud.ServiceClient) string {
- return c.ServiceURL("")
+ u, _ := url.Parse(c.ServiceURL(""))
+ u.Path = "/"
+ return u.String()
}
diff --git a/openstack/blockstorage/v1/apiversions/urls_test.go b/openstack/blockstorage/v1/apiversions/urls_test.go
index 37e9142..68cfb8c 100644
--- a/openstack/blockstorage/v1/apiversions/urls_test.go
+++ b/openstack/blockstorage/v1/apiversions/urls_test.go
@@ -8,11 +8,16 @@
)
const endpoint = "http://localhost:57909/"
+const endpoint2 = "http://localhost:57909/v1/3a02ee0b5cf14816b41b17e851d29a94"
func endpointClient() *gophercloud.ServiceClient {
return &gophercloud.ServiceClient{Endpoint: endpoint}
}
+func endpointClient2() *gophercloud.ServiceClient {
+ return &gophercloud.ServiceClient{Endpoint: endpoint2}
+}
+
func TestGetURL(t *testing.T) {
actual := getURL(endpointClient(), "v1")
expected := endpoint + "v1/"
@@ -20,7 +25,7 @@
}
func TestListURL(t *testing.T) {
- actual := listURL(endpointClient())
+ actual := listURL(endpointClient2())
expected := endpoint
th.AssertEquals(t, expected, actual)
}