lib/fezzik/host_task.rb in fezzik-0.8.0 vs lib/fezzik/host_task.rb in fezzik-0.8.1
- old
+ new
@@ -16,27 +16,27 @@
def execute(args = nil)
return if Rake.application.options.dryrun
if @roles.empty?
hosts = Fezzik.get(:domain).map { |domain| "#{Fezzik.get(:user)}@#{domain}" }
- @@connection_pool ||= Weave.connect(hosts)
+ @@connection_pool ||= Weave::ConnectionPool.new
@host_actions.each do |action|
begin
- @@connection_pool.execute(:args => [self, args], &action)
+ @@connection_pool.execute_with(hosts, :args => [self, args], &action)
rescue Weave::Error => e
STDERR.puts "Error running command in HostTask '#{@name}':"
abort e.message
end
end
else
@roles.each do |role|
Fezzik.with_role(role) do
hosts = Fezzik.get(:domain).map { |domain| "#{Fezzik.get(:user)}@#{domain}" }
@@role_connection_pools ||= {}
- @@role_connection_pools[role] ||= Weave.connect(hosts)
+ @@role_connection_pools[role] ||= Weave::ConnectionPool.new
@host_actions.each do |action|
begin
- @@role_connection_pools[role].execute(:args => [self, args], &action)
+ @@role_connection_pools[role].execute_with(hosts, :args => [self, args], &action)
rescue Weave::Error => e
STDERR.puts "Error running command in HostTask '#{@name}' with role '#{role}':"
abort e.message
end
end