ridley 0.11.1 → 0.11.2
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile
CHANGED
@@ -53,10 +53,10 @@ module Ridley
|
|
53
53
|
ssh_port, winrm_port = parse_port_options(options)
|
54
54
|
timeout = options[:ssh] && options[:ssh][:timeout]
|
55
55
|
|
56
|
-
if connector_port_open?(host,
|
57
|
-
host_connector = Ridley::HostConnector::SSH
|
58
|
-
elsif connector_port_open?(host, winrm_port)
|
56
|
+
if connector_port_open?(host, winrm_port)
|
59
57
|
host_connector = Ridley::HostConnector::WinRM
|
58
|
+
elsif connector_port_open?(host, ssh_port, timeout)
|
59
|
+
host_connector = Ridley::HostConnector::SSH
|
60
60
|
else
|
61
61
|
raise Ridley::Errors::HostConnectionError, "No available connection method available on #{host}."
|
62
62
|
end
|
@@ -86,7 +86,12 @@ module Ridley
|
|
86
86
|
|
87
87
|
# @return [WinRM::WinRMWebService]
|
88
88
|
def winrm
|
89
|
-
|
89
|
+
@winrm_client ||= begin
|
90
|
+
client = ::WinRM::WinRMWebService.new(winrm_endpoint, :plaintext,
|
91
|
+
user: user, pass: password, disable_sspi: true, basic_auth_only: true)
|
92
|
+
client.set_timeout(6000)
|
93
|
+
client
|
94
|
+
end
|
90
95
|
end
|
91
96
|
|
92
97
|
# @return [Fixnum]
|
data/lib/ridley/version.rb
CHANGED
@@ -40,7 +40,7 @@ describe Ridley::Chef::Cookbook do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
context "when a metadata.rb is missing but metadata.json is present"
|
43
|
+
context "when a metadata.rb is missing but metadata.json is present" do
|
44
44
|
let(:cookbook_path) { tmp_path.join("temp_cookbook").to_s }
|
45
45
|
|
46
46
|
before do
|
@@ -96,15 +96,15 @@ describe Ridley::HostConnector do
|
|
96
96
|
|
97
97
|
context "when an SSH port is open" do
|
98
98
|
it "returns Ridley::HostConnector::SSH" do
|
99
|
-
subject.stub(:connector_port_open?).and_return(true)
|
100
|
-
subject.best_connector_for(host).
|
99
|
+
subject.stub(:connector_port_open?).and_return(false, true)
|
100
|
+
expect(subject.best_connector_for(host)).to eq(Ridley::HostConnector::SSH)
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
104
|
context "when an SSH port isnt open and a WinRM port is open" do
|
105
105
|
it "retrns Ridley::HostConnector::WinRM" do
|
106
|
-
subject.stub(:connector_port_open?).and_return(
|
107
|
-
subject.best_connector_for(host).
|
106
|
+
subject.stub(:connector_port_open?).and_return(true, false)
|
107
|
+
expect(subject.best_connector_for(host)).to eq(Ridley::HostConnector::WinRM)
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
@@ -119,9 +119,9 @@ describe Ridley::HostConnector do
|
|
119
119
|
|
120
120
|
context "when a block is provided" do
|
121
121
|
it "yields the best HostConnector to the block" do
|
122
|
-
subject.stub(:connector_port_open?).and_return(true)
|
122
|
+
subject.stub(:connector_port_open?).and_return(false, true)
|
123
123
|
subject.best_connector_for(host) do |yielded|
|
124
|
-
yielded.
|
124
|
+
expect(yielded).to eq(Ridley::HostConnector::SSH)
|
125
125
|
end
|
126
126
|
end
|
127
127
|
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.11.
|
4
|
+
version: 0.11.2
|
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-05-
|
12
|
+
date: 2013-05-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -456,7 +456,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
456
456
|
version: '0'
|
457
457
|
segments:
|
458
458
|
- 0
|
459
|
-
hash:
|
459
|
+
hash: 4471568292874425542
|
460
460
|
requirements: []
|
461
461
|
rubyforge_project:
|
462
462
|
rubygems_version: 1.8.23
|