Adding DeleteResult for v3.services.Delete
diff --git a/openstack/identity/v3/services/requests.go b/openstack/identity/v3/services/requests.go
index 425a67c..bf027e8 100644
--- a/openstack/identity/v3/services/requests.go
+++ b/openstack/identity/v3/services/requests.go
@@ -89,10 +89,11 @@
// Delete removes an existing service.
// It either deletes all associated endpoints, or fails until all endpoints are deleted.
-func Delete(client *gophercloud.ServiceClient, serviceID string) error {
- _, err := perigee.Request("DELETE", serviceURL(client, serviceID), perigee.Options{
+func Delete(client *gophercloud.ServiceClient, serviceID string) DeleteResult {
+ var res DeleteResult
+ _, res.Err = perigee.Request("DELETE", serviceURL(client, serviceID), perigee.Options{
MoreHeaders: client.AuthenticatedHeaders(),
OkCodes: []int{204},
})
- return err
+ return res
}
diff --git a/openstack/identity/v3/services/requests_test.go b/openstack/identity/v3/services/requests_test.go
index 337647c..32e6d1b 100644
--- a/openstack/identity/v3/services/requests_test.go
+++ b/openstack/identity/v3/services/requests_test.go
@@ -204,8 +204,6 @@
w.WriteHeader(http.StatusNoContent)
})
- err := Delete(client.ServiceClient(), "12345")
- if err != nil {
- t.Fatalf("Unable to delete service: %v", err)
- }
+ res := Delete(client.ServiceClient(), "12345")
+ testhelper.AssertNoErr(t, res.Err)
}
diff --git a/openstack/identity/v3/services/results.go b/openstack/identity/v3/services/results.go
index dcd7fe2..0653198 100644
--- a/openstack/identity/v3/services/results.go
+++ b/openstack/identity/v3/services/results.go
@@ -42,6 +42,11 @@
commonResult
}
+// DeleteResult is the deferred result of an Delete call.
+type DeleteResult struct {
+ commonResult
+}
+
// Service is the result of a list or information query.
type Service struct {
Description *string `json:"description,omitempty"`