ExtractErrResult -> ErrResult; Extract -> ExtractErr
diff --git a/acceptance/openstack/blockstorage/v1/snapshots_test.go b/acceptance/openstack/blockstorage/v1/snapshots_test.go
index 1e639de..beba96c 100644
--- a/acceptance/openstack/blockstorage/v1/snapshots_test.go
+++ b/acceptance/openstack/blockstorage/v1/snapshots_test.go
@@ -47,7 +47,7 @@
t.Logf("Created snapshot: %+v\n", ss)
- err = snapshots.Delete(client, ss.ID).Extract()
+ err = snapshots.Delete(client, ss.ID).ExtractErr()
if err != nil {
t.Fatalf("Failed to delete snapshot: %v", err)
}
@@ -66,7 +66,7 @@
t.Log("Deleted snapshot\n")
- err = volumes.Delete(client, v.ID).Extract()
+ err = volumes.Delete(client, v.ID).ExtractErr()
if err != nil {
t.Errorf("Failed to delete volume: %v", err)
}
diff --git a/acceptance/openstack/blockstorage/v1/volumes_test.go b/acceptance/openstack/blockstorage/v1/volumes_test.go
index b2f2600..924a95d 100644
--- a/acceptance/openstack/blockstorage/v1/volumes_test.go
+++ b/acceptance/openstack/blockstorage/v1/volumes_test.go
@@ -47,7 +47,7 @@
if err != nil {
t.Error(err)
}
- err = volumes.Delete(client, cv.ID).Extract()
+ err = volumes.Delete(client, cv.ID).ExtractErr()
if err != nil {
t.Error(err)
return
diff --git a/acceptance/openstack/blockstorage/v1/volumetypes_test.go b/acceptance/openstack/blockstorage/v1/volumetypes_test.go
index 416e341..fe13b1d 100644
--- a/acceptance/openstack/blockstorage/v1/volumetypes_test.go
+++ b/acceptance/openstack/blockstorage/v1/volumetypes_test.go
@@ -29,7 +29,7 @@
}
defer func() {
time.Sleep(10000 * time.Millisecond)
- err = volumetypes.Delete(client, vt.ID)
+ err = volumetypes.Delete(client, vt.ID).ExtractErr()
if err != nil {
t.Error(err)
return
diff --git a/acceptance/rackspace/compute/v2/keypairs_test.go b/acceptance/rackspace/compute/v2/keypairs_test.go
index ac5a1f2..9bd6eb4 100644
--- a/acceptance/rackspace/compute/v2/keypairs_test.go
+++ b/acceptance/rackspace/compute/v2/keypairs_test.go
@@ -14,7 +14,7 @@
)
func deleteKeyPair(t *testing.T, client *gophercloud.ServiceClient, name string) {
- err := keypairs.Delete(client, name).Extract()
+ err := keypairs.Delete(client, name).ExtractErr()
th.AssertNoErr(t, err)
t.Logf("Successfully deleted key [%s].", name)
}
diff --git a/acceptance/rackspace/compute/v2/servers_test.go b/acceptance/rackspace/compute/v2/servers_test.go
index 58b5fa3..511f0a9 100644
--- a/acceptance/rackspace/compute/v2/servers_test.go
+++ b/acceptance/rackspace/compute/v2/servers_test.go
@@ -175,7 +175,7 @@
func deleteServerKeyPair(t *testing.T, client *gophercloud.ServiceClient, k *oskey.KeyPair) {
t.Logf("> keypairs.Delete")
- err := keypairs.Delete(client, k.Name).Extract()
+ err := keypairs.Delete(client, k.Name).ExtractErr()
th.AssertNoErr(t, err)
t.Logf("Keypair deleted successfully.")
diff --git a/openstack/blockstorage/v1/snapshots/results.go b/openstack/blockstorage/v1/snapshots/results.go
index c531a04..e595798 100644
--- a/openstack/blockstorage/v1/snapshots/results.go
+++ b/openstack/blockstorage/v1/snapshots/results.go
@@ -61,7 +61,7 @@
// DeleteResult contains the response body and error from a Delete request.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// ListResult is a pagination.Pager that is returned from a call to the List function.
diff --git a/openstack/blockstorage/v1/volumes/results.go b/openstack/blockstorage/v1/volumes/results.go
index 0572558..c6ddbb5 100644
--- a/openstack/blockstorage/v1/volumes/results.go
+++ b/openstack/blockstorage/v1/volumes/results.go
@@ -61,7 +61,7 @@
// DeleteResult contains the response body and error from a Delete request.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// ListResult is a pagination.pager that is returned from a call to the List function.
diff --git a/openstack/blockstorage/v1/volumetypes/requests.go b/openstack/blockstorage/v1/volumetypes/requests.go
index 32d323d..87e20f6 100644
--- a/openstack/blockstorage/v1/volumetypes/requests.go
+++ b/openstack/blockstorage/v1/volumetypes/requests.go
@@ -55,12 +55,13 @@
}
// Delete will delete the volume type with the provided ID.
-func Delete(client *gophercloud.ServiceClient, id string) error {
- _, err := perigee.Request("DELETE", deleteURL(client, id), perigee.Options{
+func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
+ var res DeleteResult
+ _, res.Err = perigee.Request("DELETE", deleteURL(client, id), perigee.Options{
MoreHeaders: client.AuthenticatedHeaders(),
OkCodes: []int{202},
})
- return err
+ return res
}
// Get will retrieve the volume type with the provided ID. To extract the volume
diff --git a/openstack/blockstorage/v1/volumetypes/requests_test.go b/openstack/blockstorage/v1/volumetypes/requests_test.go
index 8b11786..8d40bfe 100644
--- a/openstack/blockstorage/v1/volumetypes/requests_test.go
+++ b/openstack/blockstorage/v1/volumetypes/requests_test.go
@@ -113,6 +113,6 @@
w.WriteHeader(http.StatusAccepted)
})
- err := Delete(client.ServiceClient(), "d32019d3-bc6e-4319-9c1d-6722fc136a22")
+ err := Delete(client.ServiceClient(), "d32019d3-bc6e-4319-9c1d-6722fc136a22").ExtractErr()
th.AssertNoErr(t, err)
}
diff --git a/openstack/blockstorage/v1/volumetypes/results.go b/openstack/blockstorage/v1/volumetypes/results.go
index a13f7c1..c049a04 100644
--- a/openstack/blockstorage/v1/volumetypes/results.go
+++ b/openstack/blockstorage/v1/volumetypes/results.go
@@ -23,6 +23,11 @@
commonResult
}
+// DeleteResult contains the response error from a Delete request.
+type DeleteResult struct {
+ gophercloud.ErrResult
+}
+
// ListResult is a pagination.Pager that is returned from a call to the List function.
type ListResult struct {
pagination.SinglePageBase
diff --git a/openstack/compute/v2/extensions/keypairs/requests_test.go b/openstack/compute/v2/extensions/keypairs/requests_test.go
index 502a154..67d1833 100644
--- a/openstack/compute/v2/extensions/keypairs/requests_test.go
+++ b/openstack/compute/v2/extensions/keypairs/requests_test.go
@@ -66,6 +66,6 @@
defer th.TeardownHTTP()
HandleDeleteSuccessfully(t)
- err := Delete(client.ServiceClient(), "deletedkey").Extract()
+ err := Delete(client.ServiceClient(), "deletedkey").ExtractErr()
th.AssertNoErr(t, err)
}
diff --git a/openstack/compute/v2/extensions/keypairs/results.go b/openstack/compute/v2/extensions/keypairs/results.go
index dc49f99..f1a0d8e 100644
--- a/openstack/compute/v2/extensions/keypairs/results.go
+++ b/openstack/compute/v2/extensions/keypairs/results.go
@@ -90,5 +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.ExtractErrResult
+ gophercloud.ErrResult
}
diff --git a/openstack/compute/v2/servers/results.go b/openstack/compute/v2/servers/results.go
index 63cc257..53946ba 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 {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// RebuildResult temporarily contains the response from a Rebuild call.
@@ -51,7 +51,7 @@
// ActionResult represents the result of server action operations, like reboot
type ActionResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// Server exposes only the standard OpenStack fields corresponding to a given server on the user's account.
diff --git a/openstack/identity/v3/endpoints/results.go b/openstack/identity/v3/endpoints/results.go
index 2aa0483..1281122 100644
--- a/openstack/identity/v3/endpoints/results.go
+++ b/openstack/identity/v3/endpoints/results.go
@@ -43,7 +43,7 @@
// DeleteResult is the deferred result of an Delete call.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// Endpoint describes the entry point for another service's API.
diff --git a/openstack/identity/v3/services/results.go b/openstack/identity/v3/services/results.go
index d90b1bd..1d0d141 100644
--- a/openstack/identity/v3/services/results.go
+++ b/openstack/identity/v3/services/results.go
@@ -44,7 +44,7 @@
// DeleteResult is the deferred result of an Delete call.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// Service is the result of a list or information query.
diff --git a/openstack/networking/v2/extensions/layer3/floatingips/results.go b/openstack/networking/v2/extensions/layer3/floatingips/results.go
index 84719fd..1519ad2 100644
--- a/openstack/networking/v2/extensions/layer3/floatingips/results.go
+++ b/openstack/networking/v2/extensions/layer3/floatingips/results.go
@@ -78,7 +78,7 @@
// DeleteResult represents the result of an update operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// FloatingIPPage is the page returned by a pager when traversing over a
diff --git a/openstack/networking/v2/extensions/layer3/routers/results.go b/openstack/networking/v2/extensions/layer3/routers/results.go
index 2ce1e6c..bdad4cb 100755
--- a/openstack/networking/v2/extensions/layer3/routers/results.go
+++ b/openstack/networking/v2/extensions/layer3/routers/results.go
@@ -122,7 +122,7 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// InterfaceInfo represents information about a particular router interface. As
diff --git a/openstack/networking/v2/extensions/lbaas/members/results.go b/openstack/networking/v2/extensions/lbaas/members/results.go
index 447fe29..3cad339 100644
--- a/openstack/networking/v2/extensions/lbaas/members/results.go
+++ b/openstack/networking/v2/extensions/lbaas/members/results.go
@@ -118,5 +118,5 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
diff --git a/openstack/networking/v2/extensions/lbaas/monitors/results.go b/openstack/networking/v2/extensions/lbaas/monitors/results.go
index 7f7ff97..d595abd 100644
--- a/openstack/networking/v2/extensions/lbaas/monitors/results.go
+++ b/openstack/networking/v2/extensions/lbaas/monitors/results.go
@@ -143,5 +143,5 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
diff --git a/openstack/networking/v2/extensions/lbaas/pools/results.go b/openstack/networking/v2/extensions/lbaas/pools/results.go
index 0f95e15..07ec85e 100644
--- a/openstack/networking/v2/extensions/lbaas/pools/results.go
+++ b/openstack/networking/v2/extensions/lbaas/pools/results.go
@@ -137,7 +137,7 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// AssociateResult represents the result of an association operation.
diff --git a/openstack/networking/v2/extensions/lbaas/vips/results.go b/openstack/networking/v2/extensions/lbaas/vips/results.go
index 39c980a..e1092e7 100644
--- a/openstack/networking/v2/extensions/lbaas/vips/results.go
+++ b/openstack/networking/v2/extensions/lbaas/vips/results.go
@@ -162,5 +162,5 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
diff --git a/openstack/networking/v2/extensions/security/groups/results.go b/openstack/networking/v2/extensions/security/groups/results.go
index 9df3268..49db261 100644
--- a/openstack/networking/v2/extensions/security/groups/results.go
+++ b/openstack/networking/v2/extensions/security/groups/results.go
@@ -104,5 +104,5 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
diff --git a/openstack/networking/v2/extensions/security/rules/results.go b/openstack/networking/v2/extensions/security/rules/results.go
index 6684272..6e13857 100644
--- a/openstack/networking/v2/extensions/security/rules/results.go
+++ b/openstack/networking/v2/extensions/security/rules/results.go
@@ -129,5 +129,5 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
diff --git a/openstack/networking/v2/networks/results.go b/openstack/networking/v2/networks/results.go
index 9b39e8c..3ecedde 100644
--- a/openstack/networking/v2/networks/results.go
+++ b/openstack/networking/v2/networks/results.go
@@ -42,7 +42,7 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// Network represents, well, a network.
diff --git a/openstack/networking/v2/ports/results.go b/openstack/networking/v2/ports/results.go
index 2d72c35..2511ff5 100644
--- a/openstack/networking/v2/ports/results.go
+++ b/openstack/networking/v2/ports/results.go
@@ -42,7 +42,7 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// IP is a sub-struct that represents an individual IP.
diff --git a/openstack/networking/v2/subnets/results.go b/openstack/networking/v2/subnets/results.go
index 70aa543..1910f17 100644
--- a/openstack/networking/v2/subnets/results.go
+++ b/openstack/networking/v2/subnets/results.go
@@ -42,7 +42,7 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// AllocationPool represents a sub-range of cidr available for dynamic
diff --git a/rackspace/compute/v2/keypairs/delegate_test.go b/rackspace/compute/v2/keypairs/delegate_test.go
index b72e69e..62e5df9 100644
--- a/rackspace/compute/v2/keypairs/delegate_test.go
+++ b/rackspace/compute/v2/keypairs/delegate_test.go
@@ -67,6 +67,6 @@
defer th.TeardownHTTP()
os.HandleDeleteSuccessfully(t)
- err := Delete(client.ServiceClient(), "deletedkey").Extract()
+ err := Delete(client.ServiceClient(), "deletedkey").ExtractErr()
th.AssertNoErr(t, err)
}
diff --git a/rackspace/compute/v2/networks/results.go b/rackspace/compute/v2/networks/results.go
index 558df47..eb6a76c 100644
--- a/rackspace/compute/v2/networks/results.go
+++ b/rackspace/compute/v2/networks/results.go
@@ -37,7 +37,7 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// Network represents, well, a network.
diff --git a/rackspace/compute/v2/virtualinterfaces/results.go b/rackspace/compute/v2/virtualinterfaces/results.go
index 14c7a47..26fa7f3 100644
--- a/rackspace/compute/v2/virtualinterfaces/results.go
+++ b/rackspace/compute/v2/virtualinterfaces/results.go
@@ -32,7 +32,7 @@
// DeleteResult represents the result of a delete operation.
type DeleteResult struct {
- gophercloud.ExtractErrResult
+ gophercloud.ErrResult
}
// IPAddress represents a vitual address attached to a VirtualInterface.
diff --git a/results.go b/results.go
index e691cd8..2369b2f 100644
--- a/results.go
+++ b/results.go
@@ -28,15 +28,15 @@
return string(pretty)
}
-// ExtractErrResult represents results that only contain a potential error and
+// ErrResult represents results that only contain a potential error and
// nothing else. Usually if the operation executed successfully, the Err field
// will be nil; otherwise it will be stocked with a relevant error.
-type ExtractErrResult struct {
+type ErrResult struct {
Err error
}
-// Extract is a function that extracts error information from a result
-func (r ExtractErrResult) Extract() error {
+// ExtractErr is a function that extracts error information from a result
+func (r ErrResult) ExtractErr() error {
return r.Err
}