Provider does not need to set username

If the user sets this themselves, vagrant will pick it up. If the user
does not set it, vagrant will set a default. All this works without any
code on our end.
This commit is contained in:
Brian Pitts
2014-09-28 14:49:37 -05:00
parent 4a0cd19ec5
commit e693e82ed2

View File

@@ -43,17 +43,12 @@ module VagrantPlugins
ssh_info = {
:host => ip_address,
:port => machine.config.ssh.guest_port,
:username => machine.config.ssh.username,
:forward_agent => machine.config.ssh.forward_agent,
:forward_x11 => machine.config.ssh.forward_x11,
}
ssh_info[:proxy_command] = "ssh '#{machine.provider_config.host}' -l '#{machine.provider_config.username}' nc %h %p" if machine.provider_config.connect_via_ssh
if not ssh_info[:username]
ssh_info[:username] = machine.config.ssh.default.username
end
ssh_info
end
end