bin/receive-events in flapjack-0.7.27 vs bin/receive-events in flapjack-0.7.28

- old
+ new

@@ -89,11 +89,11 @@ :size => source_redis.llen(a) } } end options = OpenStruct.new -options.config = nil +options.config = Flapjack::Configuration::DEFAULT_CONFIG_PATH options.daemonize = nil exe = File.basename(__FILE__) optparse = OptionParser.new do |opts| @@ -130,30 +130,13 @@ end end optparse.parse!(ARGV) -FLAPJACK_ENV = ENV['FLAPJACK_ENV'] || 'development' +FLAPJACK_ENV = ENV['FLAPJACK_ENV'] || 'production' -if options.config - config_file = options.config - pike "specified config file cannot be read" unless File.readable?(config_file) -else - [ 'etc/flapjack_config.yaml', - File.dirname(__FILE__) + 'etc/flapjack_config.yaml', - '/etc/flapjack/flapjack_config.yaml' ].each do |candidate| - if File.readable?(candidate) - config_file = candidate - break - else - puts "not found and/or not readable: #{candidate}" - end - end - pike "no config file specified and none found in default locations" unless config_file -end - config = Flapjack::Configuration.new -config.load(config_file) +config.load(options.config) config_env = config.all redis_options = config.for_redis if config_env.nil? || config_env.empty? puts "No config data for environment '#{FLAPJACK_ENV}' found in '#{options.config}'"