Merge pull request #1796 from Banno/bugfix-ssh-remote-exec
remote-exec (ssh): chmod'ing right path
This commit is contained in:
commit
c2695ba528
|
@ -230,7 +230,7 @@ func (c *Communicator) UploadScript(path string, input io.Reader) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := &remote.Cmd{
|
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 {
|
if err := c.Start(cmd); err != nil {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
|
@ -238,6 +238,11 @@ func (c *Communicator) UploadScript(path string, input io.Reader) error {
|
||||||
"machine: %s", err)
|
"machine: %s", err)
|
||||||
}
|
}
|
||||||
cmd.Wait()
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue