Sha256: 447b55678fb04366b24ff7e4ac4e0e3c53a01d442011f88d22d2f7a65824a98e

Contents?: true

Size: 1.62 KB

Versions: 13

Compression:

Stored size: 1.62 KB

Contents

module Rudy; module Routines;
  class Passthrough < Rudy::Routines::Base
    
    Rudy::Routines.add_routine :startup, Rudy::Routines::Startup
    Rudy::Routines.add_routine :shutdown, Rudy::Routines::Shutdown
    Rudy::Routines.add_routine :reboot, Rudy::Routines::Reboot
    
    def init(*args)
      Rudy::Routines.rescue {
        @machines = Rudy::Machines.list || []
        @@rset = Rudy::Routines::Handlers::RyeTools.create_set @machines
      }
    end
    
    def execute
      Rudy::Routines::Handlers::Depends.execute_all @before, @argv
      li " Executing routine: #{@name} ".att(:reverse), ""
      # Re-retreive the machine set to reflect dependency changes
      Rudy::Routines.rescue {
        @machines = Rudy::Machines.list || []
        @@rset = Rudy::Routines::Handlers::RyeTools.create_set @machines
      }
      
      return @machines unless run?
      Rudy::Routines.runner(@routine, @@rset, @@lbox, @argv)
      Rudy::Routines::Handlers::Depends.execute_all @after, @argv
      @machines
    end
    
    # Called by generic_machine_runner
    def raise_early_exceptions
      raise Rudy::Error, "No routine name" unless @name
      raise NoRoutine, @name unless @routine
      ##raise MachineGroupNotDefined, current_machine_group unless known_machine_group?
      # Call raise_early_exceptions for each handler used in the routine
      @routine.each_pair do |action,definition|
        raise NoHandler, action unless Rudy::Routines.has_handler?(action)
        handler = Rudy::Routines.get_handler action
        handler.raise_early_exceptions(action, definition, @@rset, @@lbox, @argv)
      end
    end
    
  end

end; end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rudy-0.9.8.020 lib/rudy/routines/passthrough.rb
rudy-0.9.8.019 lib/rudy/routines/passthrough.rb
rudy-0.9.8.018 lib/rudy/routines/passthrough.rb
rudy-0.9.8.017 lib/rudy/routines/passthrough.rb
rudy-0.9.8.016 lib/rudy/routines/passthrough.rb
rudy-0.9.8.015 lib/rudy/routines/passthrough.rb
rudy-0.9.8.014 lib/rudy/routines/passthrough.rb
rudy-0.9.8.013 lib/rudy/routines/passthrough.rb
rudy-0.9.8.012 lib/rudy/routines/passthrough.rb
rudy-0.9.8.011 lib/rudy/routines/passthrough.rb
rudy-0.9.8.010 lib/rudy/routines/passthrough.rb
rudy-0.9.8.009 lib/rudy/routines/passthrough.rb
rudy-0.9.8.008 lib/rudy/routines/passthrough.rb