provisioner/remote-exec: Clear out scripts after uploading

Prevents residual script contents from remaining on machine.

Fixes #482
This commit is contained in:
Paul Hinze 2016-03-10 20:29:23 -06:00
parent 14ca7e3156
commit 96ebf0af0e
1 changed files with 7 additions and 0 deletions

View File

@ -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 {