lib/larva/configurator.rb in larva-1.2.0 vs lib/larva/configurator.rb in larva-1.3.0

- old
+ new

@@ -18,32 +18,31 @@ def configure Filum.setup(@logfile) Filum.logger.info "Configuring Daemon" - if propono_config = parse_config_file('propono.yml') - Propono.config do |config| - config.use_iam_profile = propono_config[:use_iam_profile] - config.access_key = propono_config[:access_key] - config.secret_key = propono_config[:secret_key] - config.queue_region = propono_config[:region] - config.application_name = propono_config[:application_name] - config.queue_suffix = propono_config[:queue_suffix] - config.udp_host = "pergo.meducation.net" - config.udp_port = "9732" - config.logger = Filum.logger - end - end + propono_config = parse_config_file('propono.yml') + propono_setup(propono_config) + after_configure if respond_to?(:after_configure) end private def parse_config_file(filename) contents = ERB.new(File.read(File.join(@config_dir, filename))).result hash = YAML::load(contents) hash.stringify_keys[@env].symbolize_keys rescue - nil + Hash.new() + end + + def propono_setup(propono_config) + Propono.config do |config| + config.queue_region = propono_config.delete(:region) # Backwards compatible with region key instead of queue_region + config.logger = Filum.logger + + propono_config.each { |key, value| config.send("#{key}=", value) } + end end end end