lib/percheron/actions/start.rb in percheron-0.7.16 vs lib/percheron/actions/start.rb in percheron-0.8.0
- old
+ new
@@ -1,14 +1,13 @@
module Percheron
module Actions
class Start
-
include Base
- def initialize(unit, dependant_units: [], cmd: false, exec_scripts: true)
+ def initialize(unit, needed_units: [], cmd: false, exec_scripts: true)
@unit = unit
- @dependant_units = dependant_units
+ @needed_units = needed_units
@cmd = cmd
@exec_scripts = exec_scripts
end
def execute!
@@ -21,29 +20,29 @@
results.compact.empty? ? nil : unit
end
private
- attr_reader :unit, :dependant_units, :cmd, :exec_scripts
+ attr_reader :unit, :needed_units, :cmd, :exec_scripts
def exec_scripts?
!unit.post_start_scripts.empty? && exec_scripts
end
def create!
return nil if unit.exists?
- Create.new(unit, cmd: cmd, exec_scripts: exec_scripts).execute!
+ Create.new(unit, cmd: cmd).execute!
end
def start!
return nil if !unit.startable? || unit.running?
$logger.info "Starting '#{unit.display_name}' unit"
unit.container.start!
end
def execute_post_start_scripts!
scripts = unit.post_start_scripts
- Exec.new(unit, dependant_units, scripts, 'POST start').execute! if exec_scripts?
+ Exec.new(unit, needed_units, scripts, 'POST start').execute! if exec_scripts?
end
end
end
end