handle VM clone errors
do not try to cleanup failed VM, it it's not created
This commit is contained in:
parent
e8d8fd6205
commit
1046b5ef09
|
@ -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...")
|
||||
|
||||
|
|
Loading…
Reference in New Issue