Shifting compute operations to common delete result
diff --git a/openstack/compute/v2/extensions/keypairs/requests.go b/openstack/compute/v2/extensions/keypairs/requests.go
index 01ee12a..7d1a2ac 100644
--- a/openstack/compute/v2/extensions/keypairs/requests.go
+++ b/openstack/compute/v2/extensions/keypairs/requests.go
@@ -82,7 +82,6 @@
var res DeleteResult
_, res.Err = perigee.Request("DELETE", deleteURL(client, name), perigee.Options{
MoreHeaders: client.AuthenticatedHeaders(),
- Results: &res.Body,
OkCodes: []int{202},
})
return res
diff --git a/openstack/compute/v2/extensions/keypairs/results.go b/openstack/compute/v2/extensions/keypairs/results.go
index 96b96ea..dc49f99 100644
--- a/openstack/compute/v2/extensions/keypairs/results.go
+++ b/openstack/compute/v2/extensions/keypairs/results.go
@@ -90,10 +90,5 @@
// DeleteResult is the response from a Delete operation. Call its Extract method to determine if
// the call succeeded or failed.
type DeleteResult struct {
- gophercloud.Result
-}
-
-// Extract determines whether or not a deletion request was accepted.
-func (r DeleteResult) Extract() error {
- return r.Err
+ gophercloud.ExtractErrResult
}
diff --git a/openstack/compute/v2/servers/results.go b/openstack/compute/v2/servers/results.go
index f34d97f..b34cc19 100644
--- a/openstack/compute/v2/servers/results.go
+++ b/openstack/compute/v2/servers/results.go
@@ -41,7 +41,7 @@
// DeleteResult temporarily contains the response from an Delete call.
type DeleteResult struct {
- serverResult
+ gophercloud.ExtractErrResult
}
// RebuildResult temporarily contains the response from a Rebuild call.
@@ -54,11 +54,6 @@
gophercloud.Result
}
-// Extract is a function that extracts error information from a result
-func (r ActionResult) Extract() error {
- return r.Err
-}
-
// Server exposes only the standard OpenStack fields corresponding to a given server on the user's account.
type Server struct {
// ID uniquely identifies this server amongst all other servers, including those not accessible to the current tenant.