update unit and acceptance tests
diff --git a/openstack/blockstorage/v1/volumes/requests.go b/openstack/blockstorage/v1/volumes/requests.go
index 2a4ce91..7704012 100644
--- a/openstack/blockstorage/v1/volumes/requests.go
+++ b/openstack/blockstorage/v1/volumes/requests.go
@@ -60,7 +60,7 @@
// ListOpts holds options for listing volumes. It is passed to the volumes.List function.
type ListOpts struct {
- // AllTenants is an admin-only option. Set it to true to see a tenant volumes.
+ // AllTenants is an admin-only option. Set it to true to see all tenant volumes.
AllTenants bool
// List only volumes that contain Metadata.
Metadata map[string]string
@@ -123,11 +123,10 @@
}
-func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
- var res DeleteResult
- _, res.Err = perigee.Request("DELETE", deleteURL(client, id), perigee.Options{
+func Delete(client *gophercloud.ServiceClient, id string) error {
+ _, err := perigee.Request("DELETE", deleteURL(client, id), perigee.Options{
MoreHeaders: client.Provider.AuthenticatedHeaders(),
- OkCodes: []int{204},
+ OkCodes: []int{202, 204},
})
- return res
+ return err
}
diff --git a/openstack/blockstorage/v1/volumes/requests_test.go b/openstack/blockstorage/v1/volumes/requests_test.go
index 2ae8dd3..54ff91d 100644
--- a/openstack/blockstorage/v1/volumes/requests_test.go
+++ b/openstack/blockstorage/v1/volumes/requests_test.go
@@ -155,6 +155,6 @@
w.WriteHeader(http.StatusNoContent)
})
- res := Delete(ServiceClient(), "d32019d3-bc6e-4319-9c1d-6722fc136a22")
- th.AssertNoErr(t, res.Err)
+ err := Delete(ServiceClient(), "d32019d3-bc6e-4319-9c1d-6722fc136a22")
+ th.AssertNoErr(t, err)
}
diff --git a/openstack/blockstorage/v1/volumes/results.go b/openstack/blockstorage/v1/volumes/results.go
index 961582d..7bf83a5 100644
--- a/openstack/blockstorage/v1/volumes/results.go
+++ b/openstack/blockstorage/v1/volumes/results.go
@@ -80,5 +80,3 @@
type UpdateResult struct {
commonResult
}
-
-type DeleteResult commonResult