Permalink
Browse files

Load the config file from /mnt/app/current/config/... instead of /etc…

…/ec2onrails. Also renamed method.
  • Loading branch information...
1 parent f8aa36f commit 39cb034bd19ad365f46ed7e2d22c08ec2bb1beb3 @pauldowman committed Oct 19, 2009
@@ -137,7 +137,7 @@ def process_config_file_templates
# Set any variables that will be needed inside the templates
# We're processing ALL templates, even ones that won't be used in the current role.
rails_env = Ec2onrails::Utils.rails_env
- config = Ec2onrails::Utils.load_config
+ config = Ec2onrails::Utils.load_ec2onrails_config
roles = self.roles
Dir["/etc/**/*.erb"].each do |template|
@@ -13,12 +13,13 @@ def self.hostname
`hostname -s`.strip
end
- def self.load_config
- config = {}
- begin
- config = eval(File.read("/etc/ec2onrails/config.rb"))
- rescue Exception => e
- puts "ERROR:\n#{e.inspect}\n#{e.backtrace.join("\n")}"
+ def self.load_ec2onrails_config
+ config_file = "/mnt/app/current/config/ec2onrails/config.rb"
+ if File.exists?(config_file)
+ config = eval(File.read(config_file))
+ else
+ puts "#{config_file} doesn't exist"
+ config = {}
end
return config
end

0 comments on commit 39cb034

Please sign in to comment.