Shifting object storage operations to common delete result
diff --git a/openstack/objectstorage/v1/containers/requests.go b/openstack/objectstorage/v1/containers/requests.go
index 3fae4d9..9f3b2af 100644
--- a/openstack/objectstorage/v1/containers/requests.go
+++ b/openstack/objectstorage/v1/containers/requests.go
@@ -123,12 +123,10 @@
// Delete is a function that deletes a container.
func Delete(c *gophercloud.ServiceClient, containerName string) DeleteResult {
var res DeleteResult
- resp, err := perigee.Request("DELETE", deleteURL(c, containerName), perigee.Options{
+ _, res.Err = perigee.Request("DELETE", deleteURL(c, containerName), perigee.Options{
MoreHeaders: c.AuthenticatedHeaders(),
OkCodes: []int{202, 204},
})
- res.Header = resp.HttpResponse.Header
- res.Err = err
return res
}
diff --git a/openstack/objectstorage/v1/containers/results.go b/openstack/objectstorage/v1/containers/results.go
index c00a4bc..f7f84c3 100644
--- a/openstack/objectstorage/v1/containers/results.go
+++ b/openstack/objectstorage/v1/containers/results.go
@@ -139,5 +139,5 @@
// the headers from the HTTP response, you can invoke the 'ExtractHeaders'
// method on the result struct.
type DeleteResult struct {
- commonResult
+ gophercloud.ExtractErrResult
}
diff --git a/openstack/objectstorage/v1/objects/requests.go b/openstack/objectstorage/v1/objects/requests.go
index 0ad0315..59ea81f 100644
--- a/openstack/objectstorage/v1/objects/requests.go
+++ b/openstack/objectstorage/v1/objects/requests.go
@@ -304,12 +304,11 @@
url += query
}
- resp, err := perigee.Request("DELETE", url, perigee.Options{
+ _, res.Err = perigee.Request("DELETE", url, perigee.Options{
MoreHeaders: c.AuthenticatedHeaders(),
OkCodes: []int{204},
})
- res.Header = resp.HttpResponse.Header
- res.Err = err
+
return res
}
diff --git a/openstack/objectstorage/v1/objects/results.go b/openstack/objectstorage/v1/objects/results.go
index f85f1ac..c8f8b94 100644
--- a/openstack/objectstorage/v1/objects/results.go
+++ b/openstack/objectstorage/v1/objects/results.go
@@ -146,7 +146,7 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- commonResult
+ gophercloud.ExtractErrResult
}
// CopyResult represents the result of a copy operation.