pawnee 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -140,11 +140,23 @@ module Pawnee
140
140
  servers.each do |server|
141
141
  # Only run on this server if the server supports the current recipe's
142
142
  # role.
143
- next unless server.is_a?(String) || (server['roles'] && server['roles'].include?(self.class.class_role))
143
+ next unless server.is_a?(String) || server.is_a?(Net::SSH::Connection::Session) || (server['roles'] && server['roles'].include?(self.class.class_role))
144
144
 
145
145
  # Set the server for this call
146
146
  self.server = server.is_a?(String) ? server : server['domain']
147
147
 
148
+ # Setup the connection to the server
149
+ if server.is_a?(Net::SSH::Connection::Session)
150
+ self.destination_connection = server
151
+ elsif server.is_a?(String)
152
+ # Server name is a string, asume ubuntu
153
+ self.destination_connection = Net::SSH.start(server, 'ubuntu')
154
+ else
155
+ # Server is a hash
156
+ self.destination_connection = Net::SSH.start(server['domain'], server['user'] || 'ubuntu')
157
+ end
158
+
159
+
148
160
  # Run the task
149
161
  task.run(self, *args)
150
162
 
@@ -28,7 +28,6 @@ The test run through vagrant, which seemed logical since we want to test ssh stu
28
28
  ### Install a box (first time only)
29
29
  cd spec/vagrant
30
30
  bundle exec vagrant box add ubuntu11 http://timhuegdon.com/vagrant-boxes/ubuntu-11.10.box
31
- bundle exec vagrant init ubuntu11
32
31
 
33
32
  # enable the sandbox and create a commit we can rollback to
34
33
  bundle exec vagrant sandbox on
@@ -1,3 +1,3 @@
1
1
  module Pawnee
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
data/spec/base_spec.rb CHANGED
@@ -110,6 +110,7 @@ describe Pawnee::Base do
110
110
  }
111
111
 
112
112
  Pawnee::Base.should_receive(:config_options).at_least(:once).and_return(config_options)
113
+ Net::SSH.should_receive(:start).any_number_of_times
113
114
 
114
115
  red = Pawnee::Red::Base.new([], options)
115
116
  red.should_receive(:setup).twice
@@ -119,6 +120,7 @@ describe Pawnee::Base do
119
120
  blue.should_receive(:setup).once
120
121
  Pawnee::Blue::Base.should_receive(:new).with([], options).and_return(blue)
121
122
 
123
+
122
124
  Pawnee::Base.invoke_roles(:setup, ['red', 'blue'], options)
123
125
 
124
126
  end
@@ -132,6 +134,7 @@ describe Pawnee::Base do
132
134
  }
133
135
 
134
136
  Pawnee::Base.should_receive(:config_options).at_least(:once).and_return(options)
137
+ Net::SSH.should_receive(:start).any_number_of_times
135
138
 
136
139
  red = Pawnee::Red::Base.new([], options)
137
140
  red.should_receive(:setup).twice
@@ -152,6 +155,7 @@ describe Pawnee::Base do
152
155
  }
153
156
 
154
157
  Pawnee::Base.should_receive(:config_options).at_least(:once).and_return(options)
158
+ Net::SSH.should_receive(:start).any_number_of_times
155
159
 
156
160
  red = Pawnee::Red::Base.new([], options)
157
161
  red.should_receive(:setup).twice
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pawnee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
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: 2012-06-15 00:00:00.000000000 Z
12
+ date: 2012-06-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -307,7 +307,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
307
307
  version: '0'
308
308
  segments:
309
309
  - 0
310
- hash: -1028839069221412909
310
+ hash: 1438096213786121322
311
311
  required_rubygems_version: !ruby/object:Gem::Requirement
312
312
  none: false
313
313
  requirements:
@@ -316,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
316
  version: '0'
317
317
  segments:
318
318
  - 0
319
- hash: -1028839069221412909
319
+ hash: 1438096213786121322
320
320
  requirements: []
321
321
  rubyforge_project:
322
322
  rubygems_version: 1.8.22