From 11b4060feee027978fad79443988c9a74701c6af Mon Sep 17 00:00:00 2001 From: Luke Amdor Date: Mon, 4 May 2015 15:43:38 -0500 Subject: [PATCH 1/2] remote-exec (ssh): checking chmod command --- communicator/ssh/communicator.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index c8534c16da4b..1f2eb77d5f91 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -238,6 +238,11 @@ func (c *Communicator) UploadScript(path string, input io.Reader) error { "machine: %s", err) } cmd.Wait() + if cmd.ExitStatus != 0 { + return fmt.Errorf( + "Error chmodding script file to 0777 in remote "+ + "machine: exit status=%s", cmd.ExitStatus) + } return nil } From fbae7884eb5d9f855166930e52ebf9ab1dd8531e Mon Sep 17 00:00:00 2001 From: Luke Amdor Date: Mon, 4 May 2015 15:44:44 -0500 Subject: [PATCH 2/2] remote-exec (ssh): chmod'ing right path --- communicator/ssh/communicator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index 1f2eb77d5f91..7b0fa510ffc0 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -230,7 +230,7 @@ func (c *Communicator) UploadScript(path string, input io.Reader) error { } cmd := &remote.Cmd{ - Command: fmt.Sprintf("chmod 0777 %s", c.connInfo.ScriptPath), + Command: fmt.Sprintf("chmod 0777 %s", path), } if err := c.Start(cmd); err != nil { return fmt.Errorf(