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
commit b0d2201d55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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))