Skip to content

Commit d36378d

Browse files
committed
Support volume type delete in V3
Support volume type delete in V3
1 parent cc22247 commit d36378d

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

acceptance/openstack/blockstorage/v3/volumetypes_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestVolumeTypesList(t *testing.T) {
4545
}
4646
}
4747

48-
func TestVolumeTypesCreate(t *testing.T) {
48+
func TestVolumeTypesCreateDestory(t *testing.T) {
4949
client, err := clients.NewBlockStorageV3Client()
5050
if err != nil {
5151
t.Fatalf("Unable to create a blockstorage client: %v", err)
@@ -64,4 +64,6 @@ func TestVolumeTypesCreate(t *testing.T) {
6464
}
6565

6666
tools.PrintResource(t, vt)
67+
68+
defer volumetypes.Delete(client, vt.ID)
6769
}

openstack/blockstorage/v3/volumetypes/doc.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ Example to create a Volume Type
3737
panic(err)
3838
}
3939
fmt.Println(volumeType)
40+
41+
Example to delete a Volume TYpe
42+
43+
typeID := "0fe36e73809d46aeae6705c39077b1b3"
44+
err := volumetypes.Delete(client, typeID).ExtractErr()
45+
if err != nil{
46+
panic(err)
47+
}
4048
*/
4149

4250
package volumetypes

openstack/blockstorage/v3/volumetypes/testing/requests_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ func TestCreate(t *testing.T) {
8080
th.AssertEquals(t, n.PublicAccess, true)
8181
th.AssertEquals(t, n.ID, "6d0ff92a-0007-4780-9ece-acfe5876966a")
8282
th.AssertEquals(t, n.ExtraSpecs["capabilities"], "gpu")
83-
th.AssertEquals(t, n.ID, "6d0ff92a-0007-4780-9ece-acfe5876966a")
8483
}
8584

8685
func TestDelete(t *testing.T) {

openstack/blockstorage/v3/volumetypes/urls.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ func createURL(c *gophercloud.ServiceClient) string {
1717
func deleteURL(c *gophercloud.ServiceClient, id string) string {
1818
return c.ServiceURL("types", id)
1919
}
20-

0 commit comments

Comments
 (0)