Feature/filestorage sharenetworks delete (#122)
* sfs: Add delete for share networks
* sfs: Make name and descr required for creating share network
* sfs: Add acceptance test for share network Delete
* sfs: Remove required parameters
After taking a close look at the code it appeared that 'name'
and 'description' are not required parameters
diff --git a/acceptance/openstack/sharedfilesystems/v2/sharenetworks.go b/acceptance/openstack/sharedfilesystems/v2/sharenetworks.go
index a964515..1f75e90 100644
--- a/acceptance/openstack/sharedfilesystems/v2/sharenetworks.go
+++ b/acceptance/openstack/sharedfilesystems/v2/sharenetworks.go
@@ -31,6 +31,17 @@
return shareNetwork, nil
}
+// DeleteShareNetwork will delete a share network. An error will occur if
+// the share network was unable to be deleted.
+func DeleteShareNetwork(t *testing.T, client *gophercloud.ServiceClient, shareNetwork *sharenetworks.ShareNetwork) {
+ err := sharenetworks.Delete(client, shareNetwork.ID).ExtractErr()
+ if err != nil {
+ t.Fatalf("Failed to delete share network %s: %v", shareNetwork.ID, err)
+ }
+
+ t.Logf("Deleted share network: %s", shareNetwork.ID)
+}
+
// PrintShareNetwork will print a share network and all of its attributes.
func PrintShareNetwork(t *testing.T, sharenetwork *sharenetworks.ShareNetwork) {
t.Logf("ID: %s", sharenetwork.ID)