@@ -1184,6 +1184,7 @@ func (c *cinderDriver) CreateVolume(config *testsuites.PerTestConfig, volType te
1184
1184
}
1185
1185
1186
1186
func (v * cinderVolume ) DeleteVolume () {
1187
+ id := v .volumeID
1187
1188
name := v .volumeName
1188
1189
1189
1190
// Try to delete the volume for several seconds - it takes
@@ -1192,16 +1193,23 @@ func (v *cinderVolume) DeleteVolume() {
1192
1193
var err error
1193
1194
timeout := time .Second * 120
1194
1195
1195
- framework .Logf ("Waiting up to %v for removal of cinder volume %s" , timeout , name )
1196
+ framework .Logf ("Waiting up to %v for removal of cinder volume %s / %s " , timeout , id , name )
1196
1197
for start := time .Now (); time .Since (start ) < timeout ; time .Sleep (5 * time .Second ) {
1197
- output , err = exec .Command ("cinder" , "delete" , name ).CombinedOutput ()
1198
+ output , err = exec .Command ("cinder" , "delete" , id ).CombinedOutput ()
1198
1199
if err == nil {
1199
- framework .Logf ("Cinder volume %s deleted" , name )
1200
+ framework .Logf ("Cinder volume %s deleted" , id )
1200
1201
return
1201
1202
}
1202
- framework .Logf ("Failed to delete volume %s: %v" , name , err )
1203
+ framework .Logf ("Failed to delete volume %s / %s : %v\n %s " , id , name , err , string ( output ) )
1203
1204
}
1204
- framework .Logf ("Giving up deleting volume %s: %v\n %s" , name , err , string (output [:]))
1205
+ // Timed out, try to get "cinder show <volume>" output for easier debugging
1206
+ showOutput , showErr := exec .Command ("cinder" , "show" , id ).CombinedOutput ()
1207
+ if showErr != nil {
1208
+ framework .Logf ("Failed to show volume %s / %s: %v\n %s" , id , name , showErr , string (showOutput ))
1209
+ } else {
1210
+ framework .Logf ("Volume %s / %s:\n %s" , id , name , string (showOutput ))
1211
+ }
1212
+ framework .Failf ("Failed to delete pre-provisioned volume %s / %s: %v\n %s" , id , name , err , string (output [:]))
1205
1213
}
1206
1214
1207
1215
// GCE
0 commit comments