Merge pull request #5240 from icycle77/salt_sudo_fix
use sudo for cleaning up salt content created with sudo
This commit is contained in:
commit
794efd62b1
|
@ -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 {
|
func (p *Provisioner) removeDir(ui packer.Ui, comm packer.Communicator, dir string) error {
|
||||||
ui.Message(fmt.Sprintf("Removing directory: %s", dir))
|
ui.Message(fmt.Sprintf("Removing directory: %s", dir))
|
||||||
cmd := &packer.RemoteCmd{
|
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 {
|
if err := cmd.StartWithUi(comm, ui); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue