Identity v3 Projects Delete (#166)
diff --git a/acceptance/openstack/identity/v3/identity.go b/acceptance/openstack/identity/v3/identity.go
index 5bed8a4..f7ea48f 100644
--- a/acceptance/openstack/identity/v3/identity.go
+++ b/acceptance/openstack/identity/v3/identity.go
@@ -38,6 +38,18 @@
return project, nil
}
+// DeleteProject will delete a project by ID. A fatal error will occur if
+// the project ID failed to be deleted. This works best when using it as
+// a deferred function.
+func DeleteProject(t *testing.T, client *gophercloud.ServiceClient, projectID string) {
+ err := projects.Delete(client, projectID).ExtractErr()
+ if err != nil {
+ t.Fatalf("Unable to delete project %s: %v", projectID, err)
+ }
+
+ t.Logf("Deleted project: %s", projectID)
+}
+
// PrintEndpoint will print an endpoint and all of its attributes.
func PrintEndpoint(t *testing.T, endpoint *endpoints.Endpoint) {
t.Logf("ID: %s", endpoint.ID)