From b25b7d1fb22bf187c3740dfab04f1d11ad6ccece Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 14 Jun 2015 11:19:26 -0700 Subject: [PATCH] communicator/winrm: log exit code of processes --- communicator/winrm/communicator.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/communicator/winrm/communicator.go b/communicator/winrm/communicator.go index 82686e2a7..804580843 100644 --- a/communicator/winrm/communicator.go +++ b/communicator/winrm/communicator.go @@ -89,7 +89,10 @@ func runCommand(shell *winrm.Shell, cmd *winrm.Command, rc *packer.RemoteCmd) { go io.Copy(rc.Stderr, cmd.Stderr) cmd.Wait() - rc.SetExited(cmd.ExitCode()) + + code := cmd.ExitCode() + log.Printf("[INFO] command '%s' exited with code: %d", rc.Command, code) + rc.SetExited(code) } // Upload implementation of communicator.Communicator interface