Permalink
Browse files

Removed no machines config error for passthrough routines

  • Loading branch information...
1 parent ac4dc03 commit 981bb32c23b9837eacdc3f5a1534bbb61382f4e4 @delano delano committed Jun 1, 2009
Showing with 14 additions and 5 deletions.
  1. +9 −1 lib/rudy/huxtable.rb
  2. +1 −1 lib/rudy/routines.rb
  3. +2 −1 lib/rudy/routines/passthrough.rb
  4. +2 −2 rudy.gemspec
View
@@ -241,6 +241,7 @@ def self.keypair_path_to_name(kp)
# That's how Rudy knows the current group is defined.
def known_machine_group?
raise NoConfig unless @@config
+ return true if default_machine_group?
raise NoMachinesConfig unless @@config.machines
return false if !@@config && !@@global
zon, env, rol = @@global.zone, @@global.environment, @@global.role
@@ -327,13 +328,20 @@ def valid_routine?(action)
def fetch_machine_param(parameter)
raise "No parameter specified" unless parameter
raise NoConfig unless @@config
- raise NoMachinesConfig unless @@config.machines
+ return if !@@config.machines && default_machine_group?
+ raise NoMachinesConfig if !@@config.machines
raise NoGlobal unless @@global
top_level = @@config.machines.find(parameter)
mc = fetch_machine_config
mc[parameter] || top_level || nil
end
+ # Returns true if this is the default machine environment and role
+ def default_machine_group?
+ @@global.environment == @@config.defaults.environment &&
+ @@global.role == @@config.defaults.role
+ end
+
def fetch_machine_config
raise NoConfig unless @@config
raise NoMachinesConfig unless @@config.machines
View
@@ -80,7 +80,7 @@ def generic_machine_runner(machine_action, routine=nil, skip_check=false, skip_h
}
- lbox = Rye::Box.new('localhost')
+ lbox = Rye::Box.new('localhost', :info => false)
sconf = fetch_script_config
enjoy_every_sandwich {
@@ -24,7 +24,8 @@ def execute(&each_mach)
def raise_early_exceptions
raise Rudy::Error, "No routine name" unless @cmdname
raise NoRoutine, @cmdname unless @routine
- raise Rudy::PrivateKeyNotFound, root_keypairpath unless has_keypair?(:root)
+ # TODO: enable this for EC2 groups only
+ #raise Rudy::PrivateKeyNotFound, root_keypairpath unless has_keypair?(:root)
raise MachineGroupNotDefined, current_machine_group unless known_machine_group?
##rmach = Rudy::Machines.new
##if !@@global.offline && !rmach.running?
View
@@ -15,8 +15,8 @@
s.rubygems_version = '1.1.1'
s.add_dependency 'drydock', '>= 0.6.3'
- s.add_dependency 'caesars', '>= 0.6.8' # not released!
- s.add_dependency 'rye', '>= 0.7.1' # not released!
+ s.add_dependency 'caesars', '>= 0.6.8'
+ s.add_dependency 'rye', '>= 0.7.2'
s.add_dependency 'sysinfo', '>= 0.5.1'
s.add_dependency 'storable', '>= 0.5.2'
s.add_dependency 'annoy', '>= 0.5.0'

0 comments on commit 981bb32

Please sign in to comment.