mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-27 02:04:01 -04:00
handle VM clone errors
do not try to cleanup failed VM, it it's not created
This commit is contained in:
+6
-1
@@ -74,7 +74,12 @@ func (s *StepCloneVM) Cleanup(state multistep.StateBag) {
|
||||
}
|
||||
|
||||
ui := state.Get("ui").(packer.Ui)
|
||||
vm := state.Get("vm").(*driver.VirtualMachine)
|
||||
|
||||
st := state.Get("vm")
|
||||
if st == nil {
|
||||
return
|
||||
}
|
||||
vm := st.(*driver.VirtualMachine)
|
||||
|
||||
ui.Say("Destroying VM...")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user