fully destroy vm if it was cancelled or errored

This commit is contained in:
Megan Marsh 2020-08-17 14:07:58 -07:00
parent d74b47b734
commit 0a5cd953fc
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ func (s *StepRegister) Cleanup(state multistep.StateBag) {
}
if remoteDriver, ok := driver.(RemoteDriver); ok {
if s.SkipExport {
if s.SkipExport && !cancelled && !halted {
ui.Say("Unregistering virtual machine...")
if err := remoteDriver.Unregister(s.registeredPath); err != nil {
ui.Error(fmt.Sprintf("Error unregistering VM: %s", err))