Various fixes to URL paths
diff --git a/openstack/identity/v2/extensions/admin/roles/fixtures.go b/openstack/identity/v2/extensions/admin/roles/fixtures.go
index fe78267..a856c02 100644
--- a/openstack/identity/v2/extensions/admin/roles/fixtures.go
+++ b/openstack/identity/v2/extensions/admin/roles/fixtures.go
@@ -10,7 +10,7 @@
)
func MockListRoleResponse(t *testing.T) {
- th.Mux.HandleFunc("/OS-KSADMN/roles", func(w http.ResponseWriter, r *http.Request) {
+ th.Mux.HandleFunc("/OS-KSADM/roles", func(w http.ResponseWriter, r *http.Request) {
th.TestMethod(t, r, "GET")
th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
diff --git a/openstack/identity/v2/extensions/admin/roles/requests.go b/openstack/identity/v2/extensions/admin/roles/requests.go
index 4765534..152031a 100644
--- a/openstack/identity/v2/extensions/admin/roles/requests.go
+++ b/openstack/identity/v2/extensions/admin/roles/requests.go
@@ -23,7 +23,7 @@
_, result.Err = perigee.Request("PUT", userRoleURL(client, tenantID, userID, roleID), perigee.Options{
MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{201},
+ OkCodes: []int{200, 201},
})
return result
diff --git a/openstack/identity/v2/extensions/admin/roles/urls.go b/openstack/identity/v2/extensions/admin/roles/urls.go
index 170658d..61b3155 100644
--- a/openstack/identity/v2/extensions/admin/roles/urls.go
+++ b/openstack/identity/v2/extensions/admin/roles/urls.go
@@ -3,18 +3,19 @@
import "github.com/rackspace/gophercloud"
const (
- ExtPath = "OS-KSADMN/roles"
+ ExtPath = "OS-KSADM"
+ RolePath = "roles"
UserPath = "users"
)
func resourceURL(c *gophercloud.ServiceClient, id string) string {
- return c.ServiceURL(ExtPath, id)
+ return c.ServiceURL(ExtPath, RolePath, id)
}
func rootURL(c *gophercloud.ServiceClient) string {
- return c.ServiceURL(ExtPath)
+ return c.ServiceURL(ExtPath, RolePath)
}
func userRoleURL(c *gophercloud.ServiceClient, tenantID, userID, roleID string) string {
- return c.ServiceURL("tenants", tenantID, UserPath, userID, ExtPath, roleID)
+ return c.ServiceURL("tenants", tenantID, UserPath, userID, RolePath, ExtPath, roleID)
}