Refactor OpenStack services to use default OkCodes
diff --git a/openstack/identity/v3/endpoints/requests.go b/openstack/identity/v3/endpoints/requests.go
index 3e09b2a..7591de0 100644
--- a/openstack/identity/v3/endpoints/requests.go
+++ b/openstack/identity/v3/endpoints/requests.go
@@ -122,8 +122,6 @@
// Delete removes an endpoint from the service catalog.
func Delete(client *gophercloud.ServiceClient, endpointID string) DeleteResult {
var res DeleteResult
- _, res.Err = client.Request("DELETE", endpointURL(client, endpointID), gophercloud.RequestOpts{
- OkCodes: []int{204},
- })
+ _, res.Err = client.Request("DELETE", endpointURL(client, endpointID), gophercloud.RequestOpts{})
return res
}
diff --git a/openstack/identity/v3/services/requests.go b/openstack/identity/v3/services/requests.go
index c6820c7..a93cfe7 100644
--- a/openstack/identity/v3/services/requests.go
+++ b/openstack/identity/v3/services/requests.go
@@ -21,7 +21,6 @@
_, result.Err = client.Request("POST", listURL(client), gophercloud.RequestOpts{
JSONBody: &req,
JSONResponse: &result.Body,
- OkCodes: []int{201},
})
return result
}
@@ -53,7 +52,6 @@
var result GetResult
_, result.Err = client.Request("GET", serviceURL(client, serviceID), gophercloud.RequestOpts{
JSONResponse: &result.Body,
- OkCodes: []int{200},
})
return result
}
@@ -79,8 +77,6 @@
// It either deletes all associated endpoints, or fails until all endpoints are deleted.
func Delete(client *gophercloud.ServiceClient, serviceID string) DeleteResult {
var res DeleteResult
- _, res.Err = client.Request("DELETE", serviceURL(client, serviceID), gophercloud.RequestOpts{
- OkCodes: []int{204},
- })
+ _, res.Err = client.Request("DELETE", serviceURL(client, serviceID), gophercloud.RequestOpts{})
return res
}
diff --git a/openstack/identity/v3/tokens/requests.go b/openstack/identity/v3/tokens/requests.go
index bbd3c56..ecbe10e 100644
--- a/openstack/identity/v3/tokens/requests.go
+++ b/openstack/identity/v3/tokens/requests.go
@@ -238,7 +238,6 @@
response, result.Err = c.Request("POST", tokenURL(c), gophercloud.RequestOpts{
JSONBody: &req,
JSONResponse: &result.Body,
- OkCodes: []int{201},
})
if result.Err != nil {
return result
@@ -281,7 +280,6 @@
var res RevokeResult
_, res.Err = c.Request("DELETE", tokenURL(c), gophercloud.RequestOpts{
MoreHeaders: subjectTokenHeaders(c, token),
- OkCodes: []int{204},
})
return res
}