Class: Percheron::Actions::Exec

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/percheron/actions/exec.rb

Instance Method Summary collapse

Methods included from Base

#base_dir, #in_working_directory

Constructor Details

#initialize(unit, needed_units, scripts, description) ⇒ Exec

Returns a new instance of Exec.



6
7
8
9
10
11
# File 'lib/percheron/actions/exec.rb', line 6

def initialize(unit, needed_units, scripts, description)
  @unit = unit
  @needed_units = needed_units
  @scripts = scripts
  @description = description
end

Instance Method Details

#execute!Object



13
14
15
16
17
# File 'lib/percheron/actions/exec.rb', line 13

def execute!
  $logger.debug "Executing #{description} #{scripts.inspect} on '#{unit.display_name}' unit"
  results = exec!
  results.compact.empty? ? nil : unit
end