diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2009-12-16 14:29:40 -0800 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-12-17 17:09:38 +1100 |
commit | e0488b26f04e931b17b104fd7f69f6527436e81d (patch) | |
tree | f88c3485472699ff787425f9f5d46977e4e47ff3 /lib/puppet | |
parent | 7b2e2badec926f8c43e2c4087b64b13d2e109f48 (diff) | |
download | puppet-e0488b26f04e931b17b104fd7f69f6527436e81d.tar.gz puppet-e0488b26f04e931b17b104fd7f69f6527436e81d.tar.xz puppet-e0488b26f04e931b17b104fd7f69f6527436e81d.zip |
Fix #2808 puppetqd doesn't give an error when no config is given
Added an info message about what database we're connecting to.
In the case of the default database, it looks like:
info: Connecting to sqlite3 database: /var/lib/puppet/state/clientconfigs.sqlite3
Also squashes the deprecation warning #2941, since fixing that makes
this patch smaller.
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/rails.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/puppet/rails.rb b/lib/puppet/rails.rb index 87f1bb1fb..98d8297fe 100644 --- a/lib/puppet/rails.rb +++ b/lib/puppet/rails.rb @@ -29,7 +29,9 @@ module Puppet::Rails ActiveRecord::Base.verify_active_connections! begin - ActiveRecord::Base.establish_connection(database_arguments()) + args = database_arguments + Puppet.info "Connecting to #{args[:adapter]} database: #{args[:database]}" + ActiveRecord::Base.establish_connection(args) rescue => detail if Puppet[:trace] puts detail.backtrace @@ -46,7 +48,7 @@ module Puppet::Rails case adapter when "sqlite3" - args[:dbfile] = Puppet[:dblocation] + args[:database] = Puppet[:dblocation] when "mysql", "postgresql" args[:host] = Puppet[:dbserver] unless Puppet[:dbserver].empty? args[:username] = Puppet[:dbuser] unless Puppet[:dbuser].empty? |