diff options
author | Adam Jacob <adam@hjksolutions.com> | 2008-10-07 12:18:40 -0700 |
---|---|---|
committer | Adam Jacob <adam@hjksolutions.com> | 2008-10-07 12:18:40 -0700 |
commit | f3df32886f55ec1d7e233f159806e7434e381e8a (patch) | |
tree | 38836c0f5f3c7c801ef09e3764b518e6212c63e6 /lib | |
parent | bd0d964eb5b91ac655a8ae8b9cc9ec00b093f116 (diff) | |
download | chef-f3df32886f55ec1d7e233f159806e7434e381e8a.tar.gz |
Updating config file paths
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/node.rb | 7 | ||||
-rw-r--r-- | lib/chef_server/init.rb | 10 |
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/chef/node.rb b/lib/chef/node.rb index 4eb72e1856..e440e3a940 100644 --- a/lib/chef/node.rb +++ b/lib/chef/node.rb @@ -122,6 +122,13 @@ class Chef def []=(attrib, value) @attribute[attrib] = value end + + # Yield each key to the block + def each(&block) + @attribute.each_key do |k| + yield(k) + end + end # Iterates over each attribute, passing the attribute and value to the block. def each_attribute(&block) diff --git a/lib/chef_server/init.rb b/lib/chef_server/init.rb index 2e4e58bb97..991a6f5c8b 100644 --- a/lib/chef_server/init.rb +++ b/lib/chef_server/init.rb @@ -82,7 +82,15 @@ Merb.disable :json # dependencies "RedCloth" => "> 3.0", "ruby-aes-cext" => "= 1.0" Merb::BootLoader.after_app_loads do # Add dependencies here that must load after the application loads: - Chef::Config.from_file(File.join(File.dirname(__FILE__), "..", "..", "config", "chef-server.rb")) + if File.exist?(File.dirname(__FILE__), "..", "..", "config", "server.rb") + Chef::Config.from_file( + File.join(File.dirname(__FILE__), "..", "..", "config", "server.rb") + ) + else + Chef::Config.from_file( + File.join("etc", "config", "server.rb") + ) + end Chef::Queue.connect # create the couch design docs for nodes and openid registrations |