fully destroy vm if it was cancelled or errored
This commit is contained in:
parent
d74b47b734
commit
0a5cd953fc
|
@ -54,7 +54,7 @@ func (s *StepRegister) Cleanup(state multistep.StateBag) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if remoteDriver, ok := driver.(RemoteDriver); ok {
|
if remoteDriver, ok := driver.(RemoteDriver); ok {
|
||||||
if s.SkipExport {
|
if s.SkipExport && !cancelled && !halted {
|
||||||
ui.Say("Unregistering virtual machine...")
|
ui.Say("Unregistering virtual machine...")
|
||||||
if err := remoteDriver.Unregister(s.registeredPath); err != nil {
|
if err := remoteDriver.Unregister(s.registeredPath); err != nil {
|
||||||
ui.Error(fmt.Sprintf("Error unregistering VM: %s", err))
|
ui.Error(fmt.Sprintf("Error unregistering VM: %s", err))
|
||||||
|
|
Loading…
Reference in New Issue