Skip to content

Commit

Permalink
Merge pull request #5577 from hashicorp/phinze/remote-exec-empty-file
Browse files Browse the repository at this point in the history
provisioner/remote-exec: Clear out scripts after uploading
  • Loading branch information
phinze committed Mar 14, 2016
2 parents d4075c9 + 96ebf0a commit 76377c9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions builtin/provisioners/remote-exec/resource_provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ func (p *ResourceProvisioner) runScripts(
return fmt.Errorf("Error starting script: %v", err)
}

// Upload a blank follow up file in the same path to prevent residual
// script contents from remaining on remote machine
empty := bytes.NewReader([]byte(""))
if err := comm.Upload(remotePath, empty); err != nil {
return fmt.Errorf("Failed to upload empty follow up script: %v", err)
}

return nil
})
if err == nil {
Expand Down

0 comments on commit 76377c9

Please sign in to comment.