[proxy] print all stderr from callWeave to the proxy logs, even if successful

This commit is contained in:
Paul Bellamy committed 2015-07-03 15:45:09 +01:00
1 parent fcea6fcbf8
commit 7821412bf7
3 files changed
+13 -8

No files matched your search

+6 -3
View File
@@ -18,13 +18,16 @@ var (
weaveWaitEntrypoint = []string{"/w/w"}
)
func callWeave(args ...string) ([]byte, error) {
func callWeave(args ...string) ([]byte, []byte, error) {
args = append([]string{"--local"}, args...)
Log.Debug("Calling weave", args)
cmd := exec.Command("./weave", args...)
cmd.Env = []string{"PROCFS=/hostproc", "PATH=/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}
out, err := cmd.CombinedOutput()
return out, err
var stdout, stderr bytes.Buffer
cmd.Stdout = &stdout
cmd.Stderr = &stderr
err := cmd.Run()
return stdout.Bytes(), stderr.Bytes(), err
}
func marshalRequestBody(r *http.Request, body interface{}) error {