Sha256: d610bcaa1d2345134eb2dcf7d13c1db54291d182a6bfa11d41cd8fd9c637c995

Contents?: true

Size: 1.14 KB

Versions: 9

Compression:

Stored size: 1.14 KB

Contents


module Rudy; module Routines;
  class Startup < Rudy::Routines::Base
    
    def init(*args)
      @routine = fetch_routine_config(:startup)
    end
    
    # * +each_mach+ is an optional block which is executed between 
    # disk creation and the after scripts. The will receives two 
    # arguments: instances of Rudy::Machine and Rye::Box.
    # Returns an Array of Rudy::Machine objects
    def execute(&each_mach)
      routine_separator(:startup)
      unless @routine
        STDERR.puts "[this is a generic startup routine]"
        @routine = {}
      end
      machines = generic_machine_runner(:create) 
      machines
    end

    # Called by generic_machine_runner
    def raise_early_exceptions
      rmach = Rudy::Machines.new
      # There's no keypair check here because Rudy::Machines will create one 
      raise MachineGroupNotDefined, current_machine_group unless known_machine_group?
      # We don't check @@global.offline b/c we can't create EC2 instances
      # without an internet connection. Use passthrough for routine tests.
      raise MachineGroupAlreadyRunning, current_machine_group if rmach.running?
    end
    
  end

end; end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
sabat-rudy-0.8.0 lib/rudy/routines/startup.rb
solutious-rudy-0.7.5 lib/rudy/routines/startup.rb
solutious-rudy-0.7.6 lib/rudy/routines/startup.rb
solutious-rudy-0.8.0 lib/rudy/routines/startup.rb
solutious-rudy-0.8.1 lib/rudy/routines/startup.rb
solutious-rudy-0.8.2 lib/rudy/routines/startup.rb
rudy-0.7.6 lib/rudy/routines/startup.rb
rudy-0.8.0 lib/rudy/routines/startup.rb
rudy-0.8.1 lib/rudy/routines/startup.rb