Sha256: 3b0412d91b5e15ad8f352939c6dfbc7b46a691307ad1580e60d842f2a53a65b8

Contents?: true

Size: 1.11 KB

Versions: 5

Compression:

Stored size: 1.11 KB

Contents


module Rudy; module Routines;
  class Passthrough < Rudy::Routines::Base
    
    def init(*args)
      @routine_name = args.first
      @routine = fetch_routine_config(@routine_name)
    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.
    def execute(&each_mach)
      routine_separator(@routine_name)
      machines = []
      generic_machine_runner(:list) do |machine,rbox|
        puts $/ #, "[routine: #{@routine_name}]"
        machines << machine
      end
      machines
    end

    # Called by generic_machine_runner
    def raise_early_exceptions
      raise Rudy::Error, "No routine name" unless @routine_name
      raise NoRoutine, @routine_name unless @routine
      rmach = Rudy::Machines.new
      raise Rudy::PrivateKeyNotFound, root_keypairpath unless has_keypair?(:root)
      raise MachineGroupNotDefined, current_machine_group unless known_machine_group?
      raise MachineGroupNotRunning, current_machine_group unless rmach.running?
    end
    
  end

end; end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
solutious-rudy-0.7.1 lib/rudy/routines/passthrough.rb
solutious-rudy-0.7.2 lib/rudy/routines/passthrough.rb
solutious-rudy-0.7.3 lib/rudy/routines/passthrough.rb
rudy-0.7.3 lib/rudy/routines/passthrough.rb
rudy-0.7.1 lib/rudy/routines/passthrough.rb