Merge pull request #9782 from hashicorp/fix_9151

fully destroy vm if it was cancelled or errored
This commit is contained in:
Megan Marsh
2020-08-18 07:22:18 -07:00
committed by GitHub
+1 -1
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))