Merge pull request #227 from desimone/patch-2

provisioners/remote-exec: More descriptive variable names for pipes.
This commit is contained in:
Mitchell Hashimoto 2014-08-26 15:35:45 -07:00
commit cefc07d665
1 changed files with 6 additions and 6 deletions

View File

@ -195,15 +195,15 @@ func (p *ResourceProvisioner) runScripts(conf *helper.SSHConfig, scripts []io.Re
} }
cmd.Wait() cmd.Wait()
rPipe1, wPipe1 := io.Pipe() stdOutReader, stdOutWriter := io.Pipe()
rPipe2, wPipe2 := io.Pipe() stdErrReader, stdErrWriter := io.Pipe()
go streamLogs(rPipe1, "stdout") go streamLogs(stdOutReader, "stdout")
go streamLogs(rPipe2, "stderr") go streamLogs(stdErrReader, "stderr")
cmd = &helper.RemoteCmd{ cmd = &helper.RemoteCmd{
Command: conf.ScriptPath, Command: conf.ScriptPath,
Stdout: wPipe1, Stdout: stdOutWriter,
Stderr: wPipe2, Stderr: stdErrWriter,
} }
if err := comm.Start(cmd); err != nil { if err := comm.Start(cmd); err != nil {
return fmt.Errorf("Error starting script: %v", err) return fmt.Errorf("Error starting script: %v", err)