diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-04 23:09:34 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-04 23:09:34 +0000 |
commit | 1f8de9d0c211ac5641f5ad827a0f478fff6bd223 (patch) | |
tree | cd376d4ec4baa846ea9d9e885af7400ea97f63f5 /lib/puppet/rails.rb | |
parent | f783859c6fb9dd7eb79a6775b3fb58441b4a8b9c (diff) | |
download | puppet-1f8de9d0c211ac5641f5ad827a0f478fff6bd223.tar.gz puppet-1f8de9d0c211ac5641f5ad827a0f478fff6bd223.tar.xz puppet-1f8de9d0c211ac5641f5ad827a0f478fff6bd223.zip |
Consolidating all of the configuration parameter declarations into configuration, at least partially just because then the docs for each parameter have to be a bit better. Also, I have gotten rid of the "puppet" section, replacing it with "main", and changed, added, or removed a couple of other sections. In general, we should now prefer more sections, rather than fewer.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2463 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/rails.rb')
-rw-r--r-- | lib/puppet/rails.rb | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/lib/puppet/rails.rb b/lib/puppet/rails.rb index 7f73fcf55..6664d8bac 100644 --- a/lib/puppet/rails.rb +++ b/lib/puppet/rails.rb @@ -4,36 +4,12 @@ require 'facter' require 'puppet' module Puppet::Rails - Puppet.config.setdefaults(:puppetmaster, - :dblocation => { :default => "$statedir/clientconfigs.sqlite3", - :mode => 0660, - :owner => "$user", - :group => "$group", - :desc => "The database cache for client configurations. Used for - querying within the language." - }, - :dbadapter => [ "sqlite3", "The type of database to use." ], - :dbmigrate => [ false, "Whether to automatically migrate the database." ], - :dbname => [ "puppet", "The name of the database to use." ], - :dbserver => [ "localhost", "The database server for Client caching. Only - used when networked databases are used."], - :dbuser => [ "puppet", "The database user for Client caching. Only - used when networked databases are used."], - :dbpassword => [ "puppet", "The database password for Client caching. Only - used when networked databases are used."], - :railslog => {:default => "$logdir/rails.log", - :mode => 0600, - :owner => "$user", - :group => "$group", - :desc => "Where Rails-specific logs are sent" - } - ) def self.connect # This global init does not work for testing, because we remove # the state dir on every test. unless ActiveRecord::Base.connected? - Puppet.config.use(:puppet) + Puppet.config.use(:main) ActiveRecord::Base.logger = Logger.new(Puppet[:railslog]) ActiveRecord::Base.allow_concurrency = true @@ -88,7 +64,7 @@ module Puppet::Rails # For now, we have to use :puppet, too, since non-puppetmasterd processes # (including testing) put the logdir in :puppet, not in :puppetmasterd. - Puppet.config.use(:puppetmaster, :puppet) + Puppet.config.use(:rails, :main, :puppetmasterd) # This has to come after we create the logdir with the :use above. ActiveRecord::Base.logger = Logger.new(Puppet[:railslog]) @@ -127,7 +103,7 @@ module Puppet::Rails raise Puppet::DevError, "No activerecord, cannot init Puppet::Rails" end - Puppet.config.use(:puppetmaster) + Puppet.config.use(:puppetmasterd, :rails) begin ActiveRecord::Base.establish_connection(database_arguments()) |