Improved some logging...

I added a debug log line in the last commit, only to find out it’s now
logging the same info twice. So removed the double entry and tweaked
the existing once.
This commit is contained in:
Sander van Harmelen 2015-05-11 15:18:32 +02:00
parent 2a5fffc24d
commit a8dacede24
3 changed files with 4 additions and 5 deletions

View File

@ -380,7 +380,6 @@ func (p *Provisioner) runCommand(
Stderr: errW,
}
log.Printf("[DEBUG] Executing remote command: %q", cmd.Command)
if err := comm.Start(cmd); err != nil {
return fmt.Errorf("Error executing command %q: %v", cmd.Command, err)
}

View File

@ -252,7 +252,7 @@ func (c *Communicator) UploadScript(path string, input io.Reader) error {
// UploadDir implementation of communicator.Communicator interface
func (c *Communicator) UploadDir(dst string, src string) error {
log.Printf("Upload dir '%s' to '%s'", src, dst)
log.Printf("Uploading dir '%s' to '%s'", src, dst)
scpFunc := func(w io.Writer, r *bufio.Reader) error {
uploadEntries := func() error {
f, err := os.Open(src)

View File

@ -125,8 +125,6 @@ func (c *Communicator) ScriptPath() string {
// Start implementation of communicator.Communicator interface
func (c *Communicator) Start(rc *remote.Cmd) error {
log.Printf("starting remote command: %s", rc.Command)
err := c.Connect(nil)
if err != nil {
return err
@ -137,6 +135,7 @@ func (c *Communicator) Start(rc *remote.Cmd) error {
return err
}
log.Printf("starting remote command: %s", rc.Command)
cmd, err := shell.Execute(rc.Command)
if err != nil {
return err
@ -162,6 +161,7 @@ func (c *Communicator) Upload(path string, input io.Reader) error {
if err != nil {
return err
}
log.Printf("Uploading file to '%s'", path)
return wcp.Write(path, input)
}
@ -172,7 +172,7 @@ func (c *Communicator) UploadScript(path string, input io.Reader) error {
// UploadDir implementation of communicator.Communicator interface
func (c *Communicator) UploadDir(dst string, src string) error {
log.Printf("Upload dir '%s' to '%s'", src, dst)
log.Printf("Uploading dir '%s' to '%s'", src, dst)
wcp, err := c.newCopyClient()
if err != nil {
return err