Remove version from the extensions resource URLs.
diff --git a/openstack/common/extensions/requests_test.go b/openstack/common/extensions/requests_test.go
index 5741280..b0f655a 100644
--- a/openstack/common/extensions/requests_test.go
+++ b/openstack/common/extensions/requests_test.go
@@ -25,7 +25,7 @@
th.SetupHTTP()
defer th.TeardownHTTP()
- th.Mux.HandleFunc("/v2.0/extensions", func(w http.ResponseWriter, r *http.Request) {
+ th.Mux.HandleFunc("/extensions", func(w http.ResponseWriter, r *http.Request) {
th.TestMethod(t, r, "GET")
th.TestHeader(t, r, "X-Auth-Token", TokenID)
@@ -33,16 +33,16 @@
fmt.Fprintf(w, `
{
- "extensions": [
- {
- "updated": "2013-01-20T00:00:00-00:00",
- "name": "Neutron Service Type Management",
- "links": [],
- "namespace": "http://docs.openstack.org/ext/neutron/service-type/api/v1.0",
- "alias": "service-type",
- "description": "API for retrieving service providers for Neutron advanced services"
- }
- ]
+ "extensions": [
+ {
+ "updated": "2013-01-20T00:00:00-00:00",
+ "name": "Neutron Service Type Management",
+ "links": [],
+ "namespace": "http://docs.openstack.org/ext/neutron/service-type/api/v1.0",
+ "alias": "service-type",
+ "description": "API for retrieving service providers for Neutron advanced services"
+ }
+ ]
}
`)
})
@@ -90,14 +90,14 @@
fmt.Fprintf(w, `
{
- "extension": {
- "updated": "2013-02-03T10:00:00-00:00",
- "name": "agent",
- "links": [],
- "namespace": "http://docs.openstack.org/ext/agent/api/v2.0",
- "alias": "agent",
- "description": "The agent management extension."
- }
+ "extension": {
+ "updated": "2013-02-03T10:00:00-00:00",
+ "name": "agent",
+ "links": [],
+ "namespace": "http://docs.openstack.org/ext/agent/api/v2.0",
+ "alias": "agent",
+ "description": "The agent management extension."
+ }
}
`)
diff --git a/openstack/common/extensions/urls.go b/openstack/common/extensions/urls.go
index e31e76c..2d9a563 100644
--- a/openstack/common/extensions/urls.go
+++ b/openstack/common/extensions/urls.go
@@ -2,12 +2,10 @@
import "github.com/rackspace/gophercloud"
-const version = "v2.0"
-
func extensionURL(c *gophercloud.ServiceClient, name string) string {
- return c.ServiceURL(version, "extensions", name)
+ return c.ServiceURL("extensions", name)
}
func listExtensionURL(c *gophercloud.ServiceClient) string {
- return c.ServiceURL(version, "extensions")
+ return c.ServiceURL("extensions")
}
diff --git a/openstack/common/extensions/urls_test.go b/openstack/common/extensions/urls_test.go
index 2a1e6a1..94c36cc 100644
--- a/openstack/common/extensions/urls_test.go
+++ b/openstack/common/extensions/urls_test.go
@@ -15,12 +15,12 @@
func TestExtensionURL(t *testing.T) {
actual := extensionURL(endpointClient(), "agent")
- expected := endpoint + "v2.0/extensions/agent"
+ expected := endpoint + "extensions/agent"
th.AssertEquals(t, expected, actual)
}
func TestListExtensionURL(t *testing.T) {
actual := listExtensionURL(endpointClient())
- expected := endpoint + "v2.0/extensions"
+ expected := endpoint + "extensions"
th.AssertEquals(t, expected, actual)
}