Add extra log when Cinder volume deletion fails

"cinder show <id>" output will help us to debug what's wrong with the
Cinder volume.
This commit is contained in:
Jan Safranek 2020-09-23 14:41:10 +02:00
parent ead8707f3a
commit b003187053

View File

@ -1209,6 +1209,13 @@ func (v *cinderVolume) DeleteVolume() {
}
framework.Logf("Failed to delete volume %s / %s: %v\n%s", id, name, err, string(output))
}
// Timed out, try to get "cinder show <volume>" output for easier debugging
showOutput, showErr := exec.Command("cinder", "show", id).CombinedOutput()
if showErr != nil {
framework.Logf("Failed to show volume %s / %s: %v\n%s", id, name, showErr, string(showOutput))
} else {
framework.Logf("Volume %s / %s:\n%s", id, name, string(showOutput))
}
framework.Logf("Giving up deleting volume %s / %s: %v\n%s", id, name, err, string(output[:]))
}