Commit 37937c12 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

provisioner/shell: Use RemoteCmd.Wait

parent bbc5f305
...@@ -11,7 +11,6 @@ import ( ...@@ -11,7 +11,6 @@ import (
"log" "log"
"os" "os"
"strings" "strings"
"time"
) )
const DefaultRemotePath = "/tmp/script.sh" const DefaultRemotePath = "/tmp/script.sh"
...@@ -80,10 +79,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) { ...@@ -80,10 +79,7 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) {
defer stdout_w.Close() defer stdout_w.Close()
defer stderr_w.Close() defer stderr_w.Close()
for !cmd.Exited { cmd.Wait()
time.Sleep(50 * time.Millisecond)
}
exitChan <- cmd.ExitStatus exitChan <- cmd.ExitStatus
}() }()
......
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