we want to allow config precedence over ssh settings. other than host, the ssh settings will not apply to winrm

I was testing the latest Transform on Hyper-V and VirtualBox tonight and found a problem with Hyper-V. Since all settings are fed from vagrant ssh-config, most were wrong for my box. I use a different username and password than 'vagrant'  and they were not being used and kitchen was trying to talk to winrm on port 22 since that is indeed the port that shows up in ssh-config. We dont see this problem on VirtualBox since it uses a different strategy for getting the port and in my case I do use the standard vagrant user on my virtualbox box but its certainly possible someone else could use a different user.

Thanks @afiune ill take a look. The hash values come from vagrant's ssh-config command rather than kitchen.yml. However it is also populated when using winrm.

I'll definitely give this another look though.

Sent from my Windows Phone
________________________________
From: Salim<mailto:notifications@github.com>
Sent: ‎10/‎6/‎2014 7:07 AM
To: afiune/kitchen-vagrant<mailto:kitchen-vagrant@noreply.github.com>
Cc: Matt Wrock<mailto:matt@mattwrock.com>
Subject: Re: [kitchen-vagrant] we want to allow config precedence over ssh settings. other than host, the ssh settings will not apply to winrm (#2)

>          state[:ssh_key] = hash["IdentityFile"]
> -        state[:port] = hash["Port"]
> +        state[:port] = config[:port] || hash["Port"]

Every transport has always a `default_port` therefore, the `config[:port]` will always exist. I'm afraid this will never let the `hash["Port"]`coming from the `.kitchen.yml` to be used.

---
Reply to this email directly or view it on GitHub:
https://github.com/afiune/kitchen-vagrant/pull/2/files#r18458033