|
|
|
|
@ -11,8 +11,9 @@ import (
|
|
|
|
|
|
|
|
|
|
// This step imports an OVF VM into VirtualBox.
|
|
|
|
|
type StepImport struct {
|
|
|
|
|
Name string
|
|
|
|
|
ImportFlags []string
|
|
|
|
|
Name string
|
|
|
|
|
ImportFlags []string
|
|
|
|
|
KeepRegistered bool
|
|
|
|
|
|
|
|
|
|
vmName string
|
|
|
|
|
}
|
|
|
|
|
@ -42,11 +43,10 @@ func (s *StepImport) Cleanup(state multistep.StateBag) {
|
|
|
|
|
|
|
|
|
|
driver := state.Get("driver").(vboxcommon.Driver)
|
|
|
|
|
ui := state.Get("ui").(packer.Ui)
|
|
|
|
|
config := state.Get("config").(Config)
|
|
|
|
|
|
|
|
|
|
_, cancelled := state.GetOk(multistep.StateCancelled)
|
|
|
|
|
_, halted := state.GetOk(multistep.StateHalted)
|
|
|
|
|
if (config.KeepRegistered) && (!cancelled && !halted) {
|
|
|
|
|
if (s.KeepRegistered) && (!cancelled && !halted) {
|
|
|
|
|
ui.Say("Keeping virtual machine registered with VirtualBox host (keep_registered = true)")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|