diff --git a/packer/plugin/client.go b/packer/plugin/client.go index fbc458518..e380bf850 100644 --- a/packer/plugin/client.go +++ b/packer/plugin/client.go @@ -16,6 +16,7 @@ import ( "strings" "sync" "time" + "unicode" ) // This is a slice of the "managed" clients which are cleaned up when @@ -306,8 +307,10 @@ func (c *Client) logStderr(r io.Reader) { for { line, err := bufR.ReadString('\n') if line != "" { - log.Printf("%s: %s", c.config.Cmd.Path, line) c.config.Stderr.Write([]byte(line)) + + line = strings.TrimRightFunc(line, unicode.IsSpace) + log.Printf("%s: %s", c.config.Cmd.Path, line) } if err == io.EOF {