mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-11 01:30:06 -04:00
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
1 changed files with 6 additions and 1 deletions
|
|
@ -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 a new issue