Refactor OpenStack services to use default OkCodes
diff --git a/openstack/blockstorage/v1/apiversions/requests.go b/openstack/blockstorage/v1/apiversions/requests.go
index f5a793c..5b213db 100644
--- a/openstack/blockstorage/v1/apiversions/requests.go
+++ b/openstack/blockstorage/v1/apiversions/requests.go
@@ -17,7 +17,6 @@
func Get(client *gophercloud.ServiceClient, v string) GetResult {
var res GetResult
_, res.Err = client.Request("GET", getURL(client, v), gophercloud.RequestOpts{
- OkCodes: []int{200},
JSONResponse: &res.Body,
})
return res
diff --git a/openstack/blockstorage/v1/snapshots/requests.go b/openstack/blockstorage/v1/snapshots/requests.go
index 1b313a6..cb1fd51 100644
--- a/openstack/blockstorage/v1/snapshots/requests.go
+++ b/openstack/blockstorage/v1/snapshots/requests.go
@@ -78,9 +78,7 @@
// Delete will delete the existing Snapshot with the provided ID.
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = client.Request("DELETE", deleteURL(client, id), gophercloud.RequestOpts{
- OkCodes: []int{202, 204},
- })
+ _, res.Err = client.Request("DELETE", deleteURL(client, id), gophercloud.RequestOpts{})
return res
}
@@ -89,7 +87,6 @@
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var res GetResult
_, res.Err = client.Request("GET", getURL(client, id), gophercloud.RequestOpts{
- OkCodes: []int{200},
JSONResponse: &res.Body,
})
return res
diff --git a/openstack/blockstorage/v1/volumes/requests.go b/openstack/blockstorage/v1/volumes/requests.go
index e67ba10..ad4e574 100644
--- a/openstack/blockstorage/v1/volumes/requests.go
+++ b/openstack/blockstorage/v1/volumes/requests.go
@@ -94,9 +94,7 @@
// Delete will delete the existing Volume with the provided ID.
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = client.Request("DELETE", deleteURL(client, id), gophercloud.RequestOpts{
- OkCodes: []int{202, 204},
- })
+ _, res.Err = client.Request("DELETE", deleteURL(client, id), gophercloud.RequestOpts{})
return res
}
@@ -106,7 +104,6 @@
var res GetResult
_, res.Err = client.Request("GET", getURL(client, id), gophercloud.RequestOpts{
JSONResponse: &res.Body,
- OkCodes: []int{200},
})
return res
}
diff --git a/openstack/blockstorage/v1/volumetypes/requests.go b/openstack/blockstorage/v1/volumetypes/requests.go
index 6fedaa6..451f5be 100644
--- a/openstack/blockstorage/v1/volumetypes/requests.go
+++ b/openstack/blockstorage/v1/volumetypes/requests.go
@@ -45,7 +45,6 @@
}
_, res.Err = client.Request("POST", createURL(client), gophercloud.RequestOpts{
- MoreHeaders: client.AuthenticatedHeaders(),
OkCodes: []int{200, 201},
JSONBody: &reqBody,
JSONResponse: &res.Body,
@@ -56,10 +55,7 @@
// Delete will delete the volume type with the provided ID.
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
- _, res.Err = client.Request("DELETE", deleteURL(client, id), gophercloud.RequestOpts{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{202},
- })
+ _, res.Err = client.Request("DELETE", deleteURL(client, id), gophercloud.RequestOpts{})
return res
}
@@ -68,8 +64,6 @@
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var res GetResult
_, err := client.Request("GET", getURL(client, id), gophercloud.RequestOpts{
- MoreHeaders: client.AuthenticatedHeaders(),
- OkCodes: []int{200},
JSONResponse: &res.Body,
})
res.Err = err