From 29e6194e49ea76ae8556231389a8d18822d40948 Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Wed, 15 Jul 2015 12:29:42 -0700 Subject: [PATCH] Added a warning log so we can diagnose failure cases --- communicator/winrm/communicator.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/communicator/winrm/communicator.go b/communicator/winrm/communicator.go index 1efd770e0..59034fcf0 100644 --- a/communicator/winrm/communicator.go +++ b/communicator/winrm/communicator.go @@ -87,10 +87,14 @@ func runCommand(shell *winrm.Shell, cmd *winrm.Command, rc *packer.RemoteCmd) { if rc.Stdout != nil && cmd.Stdout != nil { go io.Copy(rc.Stdout, cmd.Stdout) + } else { + log.Printf("[WARN] Failed to read stdout for command '%s'", rc.Command) } if rc.Stderr != nil && cmd.Stderr != nil { go io.Copy(rc.Stderr, cmd.Stderr) + } else { + log.Printf("[WARN] Failed to read stderr for command '%s'", rc.Command) } cmd.Wait()