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.

Signed-off-by: Jesse Wolfe <[email protected]>
---
 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 87f1bb1..98d8297 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?
-- 
1.6.5

--

You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.


Reply via email to