AWS: Handle deleting volume that no longer exists

The tests in particular double-delete volumes, so we need to handle this
graciously.
This commit is contained in:
Justin Santa Barbara
2015-10-19 22:06:33 -04:00
parent 1ae1db6027
commit 6c87a4be7c
4 changed files with 32 additions and 12 deletions

View File

@@ -353,7 +353,15 @@ func deletePD(pdName string) error {
if !ok {
return fmt.Errorf("Provider does not support volumes")
}
return volumes.DeleteDisk(pdName)
deleted, err := volumes.DeleteDisk(pdName)
if err != nil {
return err
} else {
if !deleted {
Logf("Volume deletion implicitly succeeded because volume %q does not exist.", pdName)
}
return nil
}
}
}