hosts/windows: RDP cap shouldn't remove tempfile [GH-3875]
This commit is contained in:
parent
73fd9aa84e
commit
43f347a737
|
@ -31,6 +31,7 @@ BUG FIXES:
|
||||||
WinRM in some cases. [GH-3816]
|
WinRM in some cases. [GH-3816]
|
||||||
- hosts/windows: Don't execute mstsc using PowerShell since it doesn't
|
- hosts/windows: Don't execute mstsc using PowerShell since it doesn't
|
||||||
exit properly. [GH-3837]
|
exit properly. [GH-3837]
|
||||||
|
- hosts/windows: For RDP, don't remove the Tempfile right away. [GH-3875]
|
||||||
- providers/docker: Never do graceful shutdown, always use
|
- providers/docker: Never do graceful shutdown, always use
|
||||||
`docker stop`. [GH-3798]
|
`docker stop`. [GH-3798]
|
||||||
- providers/docker: Better error messaging when SSH is not ready
|
- providers/docker: Better error messaging when SSH is not ready
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require "tempfile"
|
require "pathname"
|
||||||
|
require "tmpdir"
|
||||||
|
|
||||||
require "vagrant/util/subprocess"
|
require "vagrant/util/subprocess"
|
||||||
|
|
||||||
|
@ -16,11 +17,13 @@ module VagrantPlugins
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create the ".rdp" file
|
# Create the ".rdp" file
|
||||||
config = Tempfile.new(["vagrant-rdp", ".rdp"])
|
config_path = Pathname.new(Dir.tmpdir).join(
|
||||||
opts.each do |k, v|
|
"vagrant-rdp-#{Time.now.to_i}-#{rand(10000)}.rdp")
|
||||||
config.puts("#{k}:#{v}")
|
config_path.open("w+") do |f|
|
||||||
|
opts.each do |k, v|
|
||||||
|
config.puts("#{k}:#{v}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
config.close
|
|
||||||
|
|
||||||
# Build up the args to mstsc
|
# Build up the args to mstsc
|
||||||
args = [config.path]
|
args = [config.path]
|
||||||
|
@ -30,8 +33,6 @@ module VagrantPlugins
|
||||||
|
|
||||||
# Launch it
|
# Launch it
|
||||||
Vagrant::Util::Subprocess.execute("mstsc", *args)
|
Vagrant::Util::Subprocess.execute("mstsc", *args)
|
||||||
ensure
|
|
||||||
config.close if config
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue