Skip to content

Commit ead8707

Browse files
committed
Delete pre-provisioned Cinder volume by ID
1 parent 88e3c95 commit ead8707

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/e2e/storage/drivers/in_tree.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,6 +1191,7 @@ func (c *cinderDriver) CreateVolume(config *testsuites.PerTestConfig, volType te
11911191
}
11921192

11931193
func (v *cinderVolume) DeleteVolume() {
1194+
id := v.volumeID
11941195
name := v.volumeName
11951196

11961197
// Try to delete the volume for several seconds - it takes
@@ -1199,16 +1200,16 @@ func (v *cinderVolume) DeleteVolume() {
11991200
var err error
12001201
timeout := time.Second * 120
12011202

1202-
framework.Logf("Waiting up to %v for removal of cinder volume %s", timeout, name)
1203+
framework.Logf("Waiting up to %v for removal of cinder volume %s / %s", timeout, id, name)
12031204
for start := time.Now(); time.Since(start) < timeout; time.Sleep(5 * time.Second) {
1204-
output, err = exec.Command("cinder", "delete", name).CombinedOutput()
1205+
output, err = exec.Command("cinder", "delete", id).CombinedOutput()
12051206
if err == nil {
1206-
framework.Logf("Cinder volume %s deleted", name)
1207+
framework.Logf("Cinder volume %s deleted", id)
12071208
return
12081209
}
1209-
framework.Logf("Failed to delete volume %s: %v", name, err)
1210+
framework.Logf("Failed to delete volume %s / %s: %v\n%s", id, name, err, string(output))
12101211
}
1211-
framework.Logf("Giving up deleting volume %s: %v\n%s", name, err, string(output[:]))
1212+
framework.Logf("Giving up deleting volume %s / %s: %v\n%s", id, name, err, string(output[:]))
12121213
}
12131214

12141215
// GCE

0 commit comments

Comments
 (0)