communicators/ssh: add -E to sudo to preserve env

This commit is contained in:
Mitchell Hashimoto 2013-12-03 12:07:14 -08:00
parent 26b74d3295
commit 9cd9e6e55d
1 changed files with 1 additions and 1 deletions

View File

@ -285,7 +285,7 @@ module VagrantPlugins
# need to wrap the shell in a `sudo` call.
shell_cmd = @machine.config.ssh.shell
shell_cmd = shell if shell
shell_cmd = "sudo -H #{shell_cmd}" if sudo
shell_cmd = "sudo -E -H #{shell_cmd}" if sudo
# Open the channel so we can execute or command
channel = connection.open_channel do |ch|