Merge pull request #5240 from icycle77/salt_sudo_fix

use sudo for cleaning up salt content created with sudo
This commit is contained in:
Matthew Hooker 2017-08-11 19:02:25 -07:00 committed by GitHub
commit 794efd62b1
1 changed files with 1 additions and 1 deletions

View File

@ -384,7 +384,7 @@ func (p *Provisioner) createDir(ui packer.Ui, comm packer.Communicator, dir stri
func (p *Provisioner) removeDir(ui packer.Ui, comm packer.Communicator, dir string) error {
ui.Message(fmt.Sprintf("Removing directory: %s", dir))
cmd := &packer.RemoteCmd{
Command: fmt.Sprintf("rm -rf '%s'", dir),
Command: fmt.Sprintf(p.sudo("rm -rf '%s'"), dir),
}
if err := cmd.StartWithUi(comm, ui); err != nil {
return err