On Dec 16, 2009, at 2:46 PM, Jesse Wolfe wrote:
> 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?
How backward compatible is this? That is, which version of Rails did
this start working in? 2.1 or earlier?
--
To my embarrassment I was born in bed with a lady.
--Wilson Mizner
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--
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.