Class: Pec::Command::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/pec/command/base.rb

Direct Known Subclasses

Config, Destroy, Halt, Hosts, Init, List, Status, Up

Class Method Summary collapse

Class Method Details

.after_doObject



21
# File 'lib/pec/command/base.rb', line 21

def self.after_do; end

.before_doObject



20
# File 'lib/pec/command/base.rb', line 20

def self.before_do; end

.not_fetchObject



18
# File 'lib/pec/command/base.rb', line 18

def self.not_fetch; end


13
14
15
16
# File 'lib/pec/command/base.rb', line 13

def self.print_exception(e)
  Pec::Logger.critical(e)
  Pec::Logger.info("\t" + e.backtrace.join("\n\t"))
end

.run(filter_hosts) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/pec/command/base.rb', line 3

def self.run(filter_hosts)
  before_do
  Pec.servers(filter_hosts, not_fetch) do |server,config|
    task(server, config)
  end
  after_do
  rescue => e
    print_exception(e)
end

.task(server, config) ⇒ Object



19
# File 'lib/pec/command/base.rb', line 19

def self.task(server, config); end