Allow sudo wrapping but default to no-op
This commit is contained in:
parent
c56acfab94
commit
b35c68eacc
|
@ -20,7 +20,7 @@ module VagrantPlugins
|
|||
|
||||
sudo = opts[:sudo]
|
||||
|
||||
@logger.info("Execute: #{command}")
|
||||
@logger.info("Execute: #{command} (sudo=#{sudo.inspect})")
|
||||
exit_status = nil
|
||||
|
||||
# Open the channel so we can execute or command
|
||||
|
@ -56,6 +56,9 @@ SCRIPT
|
|||
upload(tfile.path, remote_name)
|
||||
tfile.delete
|
||||
|
||||
base_cmd = shell_cmd(opts.merge(shell: base_cmd))
|
||||
@logger.debug("Base SSH exec command: #{base_cmd}")
|
||||
|
||||
ch.exec(base_cmd) do |ch2, _|
|
||||
# Setup the channel callbacks so we can get data and exit status
|
||||
ch2.on_data do |ch3, data|
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
require File.expand_path("../../../kernel_v2/config/ssh", __FILE__)
|
||||
|
||||
# forward_x11 pty sudo_command
|
||||
|
||||
module VagrantPlugins
|
||||
module CommunicatorWinSSH
|
||||
class Config < VagrantPlugins::Kernel_V2::SSHConfig
|
||||
|
||||
def finalize!
|
||||
@shell = "cmd" if @shell == UNSET_VALUE
|
||||
@sudo_command = "cmd" if @sudo_command == UNSET_VALUE
|
||||
@sudo_command = "%c" if @sudo_command == UNSET_VALUE
|
||||
if @export_command_template == UNSET_VALUE
|
||||
if @shell == "cmd"
|
||||
@export_command_template = 'set %ENV_KEY%="%ENV_VALUE%"'
|
||||
|
|
Loading…
Reference in New Issue