ridley 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,7 @@ module Ridley
19
19
  # the host to attempt to connect to
20
20
  # @option options [Hash] :ssh
21
21
  # * :port (Fixnum) the ssh port to connect on the node the bootstrap will be performed on (22)
22
+ # * :timeout (Float) [5.0] timeout value for testing SSH connection
22
23
  # @option options [Hash] :winrm
23
24
  # * :port (Fixnum) the winrm port to connect on the node the bootstrap will be performed on (5985)
24
25
  # @param block [Proc]
@@ -27,7 +28,7 @@ module Ridley
27
28
  # @return [Ridley::HostConnector] a class under Ridley::HostConnector
28
29
  def best_connector_for(host, options = {}, &block)
29
30
  ssh_port, winrm_port = parse_port_options(options)
30
- if connector_port_open?(host, ssh_port)
31
+ if connector_port_open?(host, ssh_port, options[:ssh][:timeout])
31
32
  host_connector = Ridley::HostConnector::SSH
32
33
  elsif connector_port_open?(host, winrm_port)
33
34
  host_connector = Ridley::HostConnector::WinRM
@@ -49,10 +50,12 @@ module Ridley
49
50
  # the host to attempt to connect to
50
51
  # @param port [Fixnum]
51
52
  # the port to attempt to connect on
53
+ # @param timeout [Float]
54
+ # the number of seconds to wait (default: 3)
52
55
  #
53
56
  # @return [Boolean]
54
- def connector_port_open?(host, port)
55
- Timeout::timeout(3) do
57
+ def connector_port_open?(host, port, timeout=3)
58
+ Timeout::timeout(timeout) do
56
59
  socket = TCPSocket.new(host, port)
57
60
  socket.close
58
61
  end
@@ -1,3 +1,3 @@
1
1
  module Ridley
2
- VERSION = "0.10.0"
2
+ VERSION = "0.10.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridley
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-18 00:00:00.000000000 Z
12
+ date: 2013-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -433,7 +433,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
433
433
  version: '0'
434
434
  segments:
435
435
  - 0
436
- hash: 1599994919085656023
436
+ hash: -1173467066893192737
437
437
  requirements: []
438
438
  rubyforge_project:
439
439
  rubygems_version: 1.8.23