Class: Rudy::Routines::Passthrough
- Defined in:
- lib/rudy/routines/passthrough.rb
Instance Method Summary collapse
-
#execute(&each_mach) ⇒ Object
-
each_mach
is an optional block which is executed between disk creation and the after scripts.
-
- #init(*args) ⇒ Object
-
#raise_early_exceptions ⇒ Object
Called by generic_machine_runner.
Methods inherited from Base
#enjoy_every_sandwich, #execute_dependency, #generic_machine_runner, #has_remote_task?, #initialize, #keep_going?, #machine_separator, #preliminary_separator, #routine_separator, #task_separator
Methods included from Huxtable
change_environment, change_position, change_region, change_role, change_zone, #check_keys, #config_dirname, create_domain, #current_group_name, #current_machine_address, #current_machine_count, #current_machine_group, #current_machine_hostname, #current_machine_image, #current_machine_name, #current_machine_size, #current_user, #current_user_keypairpath, debug?, #debug?, domain, domain_exists?, #group_metadata, #has_keypair?, #has_keys?, #has_pem_keys?, #has_root_keypair?, keypair_path_to_name, #known_machine_group?, #root_keypairname, #root_keypairpath, #switch_user, update_config, update_global, update_logger, #user_keypairname, #user_keypairpath
Constructor Details
This class inherits a constructor from Rudy::Routines::Base
Instance Method Details
#execute(&each_mach) ⇒ Object
-
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.
14 15 16 17 18 19 20 21 22 |
# File 'lib/rudy/routines/passthrough.rb', line 14 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 |
#init(*args) ⇒ Object
6 7 8 9 |
# File 'lib/rudy/routines/passthrough.rb', line 6 def init(*args) @routine_name = args.first @routine = fetch_routine_config(@routine_name) end |
#raise_early_exceptions ⇒ Object
Called by generic_machine_runner
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rudy/routines/passthrough.rb', line 25 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? if !@@global.offline && !rmach.running? raise MachineGroupNotRunning, current_machine_group end end |