(host Host, source string, destination string)
| 322 | } |
| 323 | |
| 324 | func (ctx *SSHContext) UploadFile(host Host, source string, destination string) (err error) { |
| 325 | c, parts := ctx.sshArgs(host, &FileTransfer{ |
| 326 | Source: source, |
| 327 | Destination: destination, |
| 328 | }) |
| 329 | cmd := exec.Command(c, parts...) |
| 330 | |
| 331 | data, err := cmd.CombinedOutput() |
| 332 | if err != nil { |
| 333 | errorMessage := fmt.Sprintf( |
| 334 | "Error on remote host %s (%s):\nCouldn't upload file: %s -> %s\n\nOriginal error:\n%s", |
| 335 | host.GetName(), host.GetTargetHost(), source, destination, string(data), |
| 336 | ) |
| 337 | return errors.New(errorMessage) |
| 338 | } |
| 339 | |
| 340 | return nil |
| 341 | } |
| 342 | |
| 343 | func (ctx *SSHContext) MakeDirs(host Host, path string, parents bool, mode os.FileMode) (err error) { |
| 344 |
nothing calls this directly
no test coverage detected