Class: SSHKit::Runner::Sequential

Inherits:
Abstract
  • Object
show all
Defined in:
lib/core_ext/sshkit/runner/sequential.rb

Direct Known Subclasses

Group

Instance Attribute Summary

Attributes inherited from Abstract

#backends

Instance Method Summary collapse

Methods inherited from Abstract

#active_backend, active_backend, #active_backend=, active_backend=, #send_cmd

Instance Method Details

#do_it(&block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/core_ext/sshkit/runner/sequential.rb', line 4

def do_it( &block)
  backends.each do |backend|
    begin

      self.active_backend = backend
      block.call(backend.host)

    rescue Exception => e
      e2 = ExecuteError.new e
      raise e2, "Exception while executing on host #{backend}: #{e.message}"
    ensure
      self.active_backend = nil
    end
    sleep wait_interval
  end
end