Skip to content

Commit

Permalink
[COOK-730] Allow the application to use a database server that is not…
Browse files Browse the repository at this point in the history
… managed by Chef.
  • Loading branch information
Andrea Campi committed Apr 12, 2012
1 parent 3097aae commit 203d214
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions providers/django.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ def install_packages
end

def created_settings_file
dbm = new_resource.find_matching_role(new_resource.database_master_role)
Chef::Log.warn("No node with role #{new_resource.database_master_role}") if new_resource.database_master_role && !dbm
host = new_resource.find_database_server(new_resource.database_master_role)

template "#{new_resource.path}/shared/#{new_resource.local_settings_base}" do
source new_resource.settings_template || "settings.py.erb"
Expand All @@ -121,7 +120,7 @@ def created_settings_file
mode "644"
variables new_resource.settings.clone
variables.update :debug => new_resource.debug, :database => {
:host => (dbm.attribute?('cloud') ? dbm['cloud']['local_ipv4'] : dbm['ipaddress']),
:host => host,
:settings => new_resource.database,
:legacy => new_resource.legacy_database_settings
}
Expand Down

0 comments on commit 203d214

Please sign in to comment.