Fix incorrect ssh-config output when '--host' is defined

Fixes: #7728
Signed-off-by: guessi <guessi@gmail.com>
This commit is contained in:
guessi 2016-10-07 19:40:36 +08:00
parent 8dd44a02da
commit c77326438b
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,10 @@ module VagrantPlugins
ssh_info = machine.ssh_info
raise Vagrant::Errors::SSHNotReady if ssh_info.nil?
if options[:host] && options[:host].to_s != machine.name.to_s
next
end
variables = {
host_key: options[:host] || machine.name || "vagrant",
ssh_host: ssh_info[:host],