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 { ...@@ -31,12 +31,10 @@ func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction {
// Wait a second to ensure VM is really shutdown. // Wait a second to ensure VM is really shutdown.
log.Println("1 second timeout to ensure VM is really shutdown") log.Println("1 second timeout to ensure VM is really shutdown")
time.Sleep(1 * time.Second) time.Sleep(1 * time.Second)
// Clear out the Packer-created forwarding rule
ui.Say("Preparing to export machine...") 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( ui.Message(fmt.Sprintf(
"Deleting forwarded port mapping for SSH (host port %d)", "Deleting forwarded port mapping for SSH (host port %d)",
state.Get("sshHostPort"))) state.Get("sshHostPort")))
...@@ -52,13 +50,12 @@ func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction { ...@@ -52,13 +50,12 @@ func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction {
// Export the VM to an OVF // Export the VM to an OVF
outputPath := filepath.Join(s.OutputDir, vmName+"."+s.Format) outputPath := filepath.Join(s.OutputDir, vmName+"."+s.Format)
command = []string{ command := []string{
"export", "export",
vmName, vmName,
"--output", "--output",
outputPath, outputPath,
} }
command = append(command, s.ExportOpts...) command = append(command, s.ExportOpts...)
ui.Say("Exporting virtual machine...") ui.Say("Exporting virtual machine...")
......
...@@ -30,11 +30,8 @@ func (s *StepForwardSSH) Run(state multistep.StateBag) multistep.StepAction { ...@@ -30,11 +30,8 @@ func (s *StepForwardSSH) Run(state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
vmName := state.Get("vmName").(string) vmName := state.Get("vmName").(string)
var sshHostPort uint sshHostPort := s.GuestPort
if s.SkipNatMapping { if !s.SkipNatMapping {
sshHostPort = s.GuestPort
log.Printf("Skipping SSH NAT mapping and using SSH port %d", sshHostPort)
} else {
log.Printf("Looking for available SSH port between %d and %d", log.Printf("Looking for available SSH port between %d and %d",
s.HostPortMin, s.HostPortMax) s.HostPortMin, s.HostPortMax)
var offset uint = 0 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