Commit bd04b52b authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

virtualbox/common: style

parent 8d6a9945
......@@ -31,12 +31,10 @@ func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction {
// Wait a second to ensure VM is really shutdown.
log.Println("1 second timeout to ensure VM is really shutdown")
time.Sleep(1 * time.Second)
// Clear out the Packer-created forwarding rule
ui.Say("Preparing to export machine...")
var command []string
if s.SkipNatMapping == false {
// Clear out the Packer-created forwarding rule
if !s.SkipNatMapping {
ui.Message(fmt.Sprintf(
"Deleting forwarded port mapping for SSH (host port %d)",
state.Get("sshHostPort")))
......@@ -52,13 +50,12 @@ func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction {
// Export the VM to an OVF
outputPath := filepath.Join(s.OutputDir, vmName+"."+s.Format)
command = []string{
command := []string{
"export",
vmName,
"--output",
outputPath,
}
command = append(command, s.ExportOpts...)
ui.Say("Exporting virtual machine...")
......
......@@ -30,11 +30,8 @@ func (s *StepForwardSSH) Run(state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui)
vmName := state.Get("vmName").(string)
var sshHostPort uint
if s.SkipNatMapping {
sshHostPort = s.GuestPort
log.Printf("Skipping SSH NAT mapping and using SSH port %d", sshHostPort)
} else {
sshHostPort := s.GuestPort
if !s.SkipNatMapping {
log.Printf("Looking for available SSH port between %d and %d",
s.HostPortMin, s.HostPortMax)
var offset uint = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment