mitchellh/vagrant — pull request #4943 by maxlinc (2014-12-11 19:25:55+00:00)
Title: Improved WinRM error handling (including better `ready?` and `wait_for_ready`)

I split this from #4236 to make things easier to review. That PR contains just changes for SSL. This PR builds on that PR so the diff currently shows SSL support, but it'll shrink once that PR is merged and I rebase.

A few notes:
1. Authentication failures are currently retriable, and I haven't changed the default `max_times`, which was set to 20, with a 10 second sleep. That means WinRM will retry authentication for 10 minutes attempt authentication!
2. This uses a pre-release gem for WinRM. So it's technically releasable (as opposed to using git), but ideally we'd wait for an official WinRM release.
3. I've modeled it after SSH. I'm not sure about all the possible errors we could get from WinRM, but I think its a good assumption that it either throws - or should throw applicable errors from `Errno`.
4. Since it's modeled after SSH there is a lot of duplicate code, and duplicate translation keys. It might be worth refactoring so they share errors and translations (e.g. `Vagrant::Errors::Communicator::ConnectionRefused` instead of `Vagrant::Errors::SSHConnectionRefused` and `VagrantPlugins::CommunicatorWinRM::Errors::ConnectionRefused`), but I'd rather focus on WinRM and save refactoring for a separate PR.