post-processor/shell-local: Fix output of debug info to stdout

This commit is contained in:
DanHam 2017-01-23 22:08:23 +00:00
parent 28051a9218
commit 5a350f5699
No known key found for this signature in database
GPG Key ID: 58E79AEDD6AA987E
1 changed files with 3 additions and 4 deletions

View File

@ -5,6 +5,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log"
"os" "os"
"strings" "strings"
@ -185,15 +186,13 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
return nil, false, fmt.Errorf("Error processing command: %s", err) return nil, false, fmt.Errorf("Error processing command: %s", err)
} }
ui.Say(fmt.Sprintf("Post processing with local shell script: %s", command)) ui.Say(fmt.Sprintf("Post processing with local shell script: %s", script))
comm := &Communicator{} comm := &Communicator{}
cmd := &packer.RemoteCmd{Command: command} cmd := &packer.RemoteCmd{Command: command}
ui.Say(fmt.Sprintf( log.Printf("starting local command: %s", command)
"Executing local script: %s",
script))
if err := cmd.StartWithUi(comm, ui); err != nil { if err := cmd.StartWithUi(comm, ui); err != nil {
return nil, false, fmt.Errorf( return nil, false, fmt.Errorf(
"Error executing script: %s\n\n"+ "Error executing script: %s\n\n"+