mitchellh/packer — pull request #194 by sit (2013-07-18 02:43:36+00:00)
Title: Re-factor shell/provisioner command output into StartWithUi

This is more of a review request to get some feedback.

Currently, there are a few different paths to executing commands on VMs via SSH... there's at least:
1. the shell provisioner does
2. the shutdown step in the VirtualBox provisioner
3. the shutdown steps in the VMware provisioner

1 and 3 log output in different ways, 2 did not at all. I was trying to debug a not-shutting-down shutdown command in VirtualBox so I made the change below to try and capture that.

Questions I had (Go-style aside):
* should the communicator/ui link be part of communicator directly, as a peer to Start? Not sure if you want to link the communicator and ui classes.
* What to name the method? I called it StartWithUi but it also Wait()s so that's not entirely accurate
* Should the VMware shutdown step be changed to act like this? (It currently writes to a byte buffer).

As always, new to Go, so any style comments welcome. Thanks.

---
We may want to capture the output of commands in multiple
places, not just the shell provisioner. In particular, it may
be helpful in debugging shutdown commands.

Extract logic from provisioner to capture SSH output with a pipe
and place it in new StartWithUi command that connects the communicator
to the ui.

Replace the virtualbox shutdown command with an appropriate call.