lib/ridley/host_connector.rb in ridley-0.12.0.rc1 vs lib/ridley/host_connector.rb in ridley-0.12.0

- old
+ new

@@ -51,13 +51,13 @@ # @return [Ridley::HostConnector] a class under Ridley::HostConnector def best_connector_for(host, options = {}, &block) ssh_port, winrm_port = parse_port_options(options) timeout = options[:ssh] && options[:ssh][:timeout] - if connector_port_open?(host, ssh_port, timeout) - host_connector = Ridley::HostConnector::SSH - elsif connector_port_open?(host, winrm_port) + if connector_port_open?(host, winrm_port) host_connector = Ridley::HostConnector::WinRM + elsif connector_port_open?(host, ssh_port, timeout) + host_connector = Ridley::HostConnector::SSH else raise Ridley::Errors::HostConnectionError, "No available connection method available on #{host}." end if block_given?