[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

Stig Sandbeck Mathisen ssm at debian.org
Wed Jul 14 10:37:37 UTC 2010


The following commit has been merged in the upstream branch:
commit 2fe2029ebc35b035e9e34bc067d3605464bf5983
Merge: cbbd3637142f090aa20d216d3272a062a63bc724 8747479d59fa211f41186c1ab68987bb4af55f0b
Author: Stig Sandbeck Mathisen <ssm at debian.org>
Date:   Mon Jul 12 15:32:22 2010 +0200

    Merge commit '2.6.0rc2' into test/upstream
    
    Conflicts:
    	CHANGELOG
    	README
    	README.rst
    	bin/filebucket
    	bin/pi
    	bin/puppet
    	bin/puppetdoc
    	bin/ralsh
    	conf/redhat/puppet.spec
    	conf/suse/puppet.spec
    	ext/nagios/check_puppet.rb
    	ext/regexp_nodes/regexp_nodes.rb
    	install.rb
    	lib/puppet.rb
    	lib/puppet/application/puppetd.rb
    	lib/puppet/configurer.rb
    	lib/puppet/defaults.rb
    	lib/puppet/file_serving/fileset.rb
    	lib/puppet/file_serving/terminus_helper.rb
    	lib/puppet/indirector/indirection.rb
    	lib/puppet/network/authstore.rb
    	lib/puppet/network/format_handler.rb
    	lib/puppet/network/handler/fileserver.rb
    	lib/puppet/network/handler/master.rb
    	lib/puppet/network/http_server/webrick.rb
    	lib/puppet/parser/ast/casestatement.rb
    	lib/puppet/parser/ast/ifstatement.rb
    	lib/puppet/parser/ast/leaf.rb
    	lib/puppet/parser/ast/selector.rb
    	lib/puppet/parser/functions/generate.rb
    	lib/puppet/parser/functions/require.rb
    	lib/puppet/parser/functions/template.rb
    	lib/puppet/parser/lexer.rb
    	lib/puppet/parser/resource.rb
    	lib/puppet/parser/scope.rb
    	lib/puppet/provider/augeas/augeas.rb
    	lib/puppet/provider/macauthorization/macauthorization.rb
    	lib/puppet/provider/maillist/mailman.rb
    	lib/puppet/provider/package/portage.rb
    	lib/puppet/provider/service/debian.rb
    	lib/puppet/provider/service/smf.rb
    	lib/puppet/provider/ssh_authorized_key/parsed.rb
    	lib/puppet/reference/configuration.rb
    	lib/puppet/reference/providers.rb
    	lib/puppet/resource/catalog.rb
    	lib/puppet/simple_graph.rb
    	lib/puppet/ssl/certificate.rb
    	lib/puppet/ssl/certificate_authority.rb
    	lib/puppet/ssl/host.rb
    	lib/puppet/sslcertificates/ca.rb
    	lib/puppet/transaction.rb
    	lib/puppet/type/augeas.rb
    	lib/puppet/type/exec.rb
    	lib/puppet/type/file.rb
    	lib/puppet/type/file/checksum.rb
    	lib/puppet/type/file/source.rb
    	lib/puppet/type/maillist.rb
    	lib/puppet/type/mount.rb
    	lib/puppet/type/tidy.rb
    	lib/puppet/util/checksums.rb
    	lib/puppet/util/monkey_patches.rb
    	lib/puppet/util/nagios_maker.rb
    	lib/puppet/util/settings.rb
    	lib/puppet/util/suidmanager.rb
    	lib/puppet/util/zaml.rb
    	man/man8/puppetca.8
    	man/man8/puppetd.8
    	man/man8/puppetmasterd.8
    	man/man8/puppetqd.8
    	man/man8/puppetrun.8
    	sbin/puppetca
    	sbin/puppetd
    	sbin/puppetmasterd
    	sbin/puppetqd
    	sbin/puppetrun
    	spec/integration/defaults.rb
    	spec/integration/parser/functions/require.rb
    	spec/unit/application/filebucket.rb
    	spec/unit/application/puppetd.rb
    	spec/unit/configurer.rb
    	spec/unit/file_serving/fileset.rb
    	spec/unit/file_serving/terminus_helper.rb
    	spec/unit/indirector/indirection.rb
    	spec/unit/network/format_handler.rb
    	spec/unit/parser/ast/casestatement.rb
    	spec/unit/parser/ast/ifstatement.rb
    	spec/unit/parser/ast/leaf.rb
    	spec/unit/parser/ast/selector.rb
    	spec/unit/parser/functions/require.rb
    	spec/unit/parser/resource.rb
    	spec/unit/parser/scope.rb
    	spec/unit/provider/augeas/augeas.rb
    	spec/unit/provider/ssh_authorized_key/parsed.rb
    	spec/unit/resource/catalog.rb
    	spec/unit/simple_graph.rb
    	spec/unit/ssl/host.rb
    	spec/unit/type/file.rb
    	spec/unit/type/tidy.rb
    	spec/unit/util/checksums.rb
    	spec/unit/util/settings.rb
    	test/certmgr/certmgr.rb
    	test/network/handler/ca.rb
    	test/network/handler/fileserver.rb
    	test/other/transactions.rb
    	test/puppet/tc_suidmanager.rb
    	test/ral/providers/package.rb
    	test/ral/type/file.rb
    	test/ral/type/resources.rb
    	test/util/settings.rb

diff --combined Rakefile
index 416bafb,8e21ceb..9c59180
--- a/Rakefile
+++ b/Rakefile
@@@ -5,11 -5,13 +5,17 @@@ $LOAD_PATH << File.join(File.dirname(__
  require 'rake'
  require 'rake/packagetask'
  require 'rake/gempackagetask'
+ require 'spec'
+ require 'spec/rake/spectask'
+ 
+ module Puppet
+     PUPPETVERSION = File.read('lib/puppet.rb')[/PUPPETVERSION *= *'(.*)'/,1] or fail "Couldn't find PUPPETVERSION"
+ end
  
 +module Puppet
 +    PUPPETVERSION = File.read('lib/puppet.rb')[/PUPPETVERSION *= *'(.*)'/,1] or fail "Couldn't find PUPPETVERSION"
 +end
 +
  Dir['tasks/**/*.rake'].each { |t| load t }
  
  FILES = FileList[
@@@ -40,24 -42,10 +46,10 @@@ en
  desc "Create the tarball and the gem - use when releasing"
  task :puppetpackages => [:create_gem, :package]
  
- desc "Run the specs under spec/"
- task :spec do
-     require 'spec'
-     require 'spec/rake/spectask'
-     begin
- #        require 'rcov'
-     rescue LoadError
-     end
- 
-     Spec::Rake::SpecTask.new do |t|
-         t.spec_opts = ['--format','s', '--loadby','mtime']
-         t.spec_files = FileList['spec/**/*.rb']
-         t.fail_on_error = false
-         if defined?(Rcov)
-             t.rcov = true
-             t.rcov_opts = ['--exclude', 'spec/*,test/*,results/*,/usr/lib/*,/usr/local/lib/*']
-         end
-      end
+ Spec::Rake::SpecTask.new do |t|
+     t.spec_opts = ['--format','s', '--loadby','mtime','--color']
+     t.pattern ='spec/{unit,integration}/**/*.rb'
+     t.fail_on_error = false
  end
  
  desc "Run the unit tests"
diff --combined examples/modules/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb
index e507462,34ab280..6d9df31
--- a/examples/modules/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb
+++ b/examples/modules/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb
@@@ -27,10 -27,10 +27,10 @@@
  
  # Jeff McCune <jeff.mccune at northstarlabs.net>
  # 2007-08-14
 -# See: http://reductivelabs.com/trac/puppet/wiki/WritingYourOwnFunctions
 +# See: http://puppetlabs.com/trac/puppet/wiki/WritingYourOwnFunctions
  
  module Puppet::Parser::Functions
-     newfunction(:hostname_to_dn, :type => :rvalue, :doc => "Given 'foo.bar.com', return 'dc=foo,dc=bar,dc=com'.") do |args|
-         args[0].split(/\./).map do |s| "dc=%s"%[s] end.join(",")
-     end
+   newfunction(:hostname_to_dn, :type => :rvalue, :doc => "Given 'foo.bar.com', return 'dc=foo,dc=bar,dc=com'.") do |args|
+     args[0].split(/\./).map do |s| "dc=#{s}" end.join(",")
+   end
  end
diff --combined ext/extlookup.rb
index 4793cba,b72fc12..19fa548
--- a/ext/extlookup.rb
+++ b/ext/extlookup.rb
@@@ -1,10 -1,10 +1,10 @@@
- # Puppet External Data Sources 
+ # Puppet External Data Sources
  #
  # This is a parser function to read data from external files, this version
  # uses CSV files but the concept can easily be adjust for databases, yaml
  # or any other queryable data source.
  #
- # The object of this is to make it obvious when it's being used, rather than 
+ # The object of this is to make it obvious when it's being used, rather than
  # magically loading data in when an module is loaded I prefer to look at the code
  # and see statements like:
  #
@@@ -34,7 -34,7 +34,7 @@@
  #
  # Now create the following data files in /etc/puppet/manifests/extdata
  #
- # domain_myclient.com.csv: 
+ # domain_myclient.com.csv:
  #    snmp_contact,John Doe <john at myclient.com>
  #    root_contact,support@%{domain}
  #    client_trusted_ips,192.168.1.130,192.168.10.0/24
@@@ -48,7 -48,7 +48,7 @@@
  #
  #    $snmp_contact = extlookup("snmp_contact")
  #
- # The obove code shows some other features, you can use any fact or variable that 
+ # The obove code shows some other features, you can use any fact or variable that
  # is in scope by simply using %{varname} in your data files, you can return arrays
  # by just having multiple values in the csv after the initial variable name.
  #
@@@ -57,8 -57,8 +57,8 @@@
  # in empty values etc.  You can however specify a default value:
  #
  #    $ntp_servers = extlookup("ntp_servers", "1.${country}.pool.ntp.org")
- # 
- # In this case it will default to "1.${country}.pool.ntp.org" if nothing is defined in 
+ #
+ # In this case it will default to "1.${country}.pool.ntp.org" if nothing is defined in
  # any data file.
  #
  # You can also specify an additional data file to search first before any others at use
@@@ -74,110 -74,108 +74,108 @@@
  # need to edit a load of manifests to do simple things like adjust a desired version number.
  #
  # For more information on installing and writing your own custom functions see:
 -#    http://reductivelabs.com/trac/puppet/wiki/WritingYourOwnFunctions
 +#    http://puppetlabs.com/trac/puppet/wiki/WritingYourOwnFunctions
  #
  # For further help contact Volcane on #puppet
  require 'csv'
-  
+ 
  module Puppet::Parser::Functions
-     newfunction(:extlookup, :type => :rvalue) do |args|
-         key = args[0]
-         default = "_ExtUNSET_"
-         datafile = "_ExtUNSET_"
- 
-         default = args[1] if args[1]
-         datafile = args[2] if args[2]
- 
-         extlookup_datadir = lookupvar('extlookup_datadir')
-         extlookup_precedence = Array.new
- 
-         # precedence values can have variables embedded in them
-         # in the form %{fqdn}, you could for example do
-         #
-         #    $extlookup_precedence = ["hosts/%{fqdn}", "common"]
-         #
-         # this will result in /path/to/extdata/hosts/your.box.com.csv
-         # being searched.
-         #
-         # we parse the precedence here because the best place to specify
-         # it would be in site.pp but site.pp is only evaluated at startup
-         # so $fqdn etc would have no meaning there, this way it gets evaluated
-         # each run and has access to the right variables for that run
-         lookupvar('extlookup_precedence').each do |prec|
-             while prec =~ /%\{(.+?)\}/
-                 prec.gsub!(/%\{#{$1}\}/, lookupvar($1))
-             end
+   newfunction(:extlookup, :type => :rvalue) do |args|
+     key = args[0]
+     default = "_ExtUNSET_"
+     datafile = "_ExtUNSET_"
+ 
+     default = args[1] if args[1]
+     datafile = args[2] if args[2]
+ 
+     extlookup_datadir = lookupvar('extlookup_datadir')
+     extlookup_precedence = Array.new
+ 
+     # precedence values can have variables embedded in them
+     # in the form %{fqdn}, you could for example do
+     #
+     #    $extlookup_precedence = ["hosts/%{fqdn}", "common"]
+     #
+     # this will result in /path/to/extdata/hosts/your.box.com.csv
+     # being searched.
+     #
+     # we parse the precedence here because the best place to specify
+     # it would be in site.pp but site.pp is only evaluated at startup
+     # so $fqdn etc would have no meaning there, this way it gets evaluated
+     # each run and has access to the right variables for that run
+     lookupvar('extlookup_precedence').each do |prec|
+       while prec =~ /%\{(.+?)\}/
+         prec.gsub!(/%\{#{$1}\}/, lookupvar($1))
+       end
+ 
+       extlookup_precedence << prec
+     end
  
-             extlookup_precedence << prec
-         end
-     
  
-         datafiles = Array.new
+     datafiles = Array.new
  
-         # if we got a custom data file, put it first in the array of search files
-         if datafile != "" 
-             if File.exists?(extlookup_datadir + "/#{datafile}.csv")
-                 datafiles << extlookup_datadir + "/#{datafile}.csv"
-             end
-         end
+     # if we got a custom data file, put it first in the array of search files
+     if datafile != ""
+       datafiles << extlookup_datadir + "/#{datafile}.csv" if File.exists?(extlookup_datadir + "/#{datafile}.csv")
+     end
  
-         extlookup_precedence.each do |d|
-             datafiles << extlookup_datadir + "/#{d}.csv"
-         end
+     extlookup_precedence.each do |d|
+       datafiles << extlookup_datadir + "/#{d}.csv"
+     end
+ 
+     desired = "_ExtUNSET_"
  
-         desired = "_ExtUNSET_"
- 
-         datafiles.each do |file|
-             parser.watch_file(file) if File.exists?(file)
- 
-             if desired == "_ExtUNSET_"
-                 if File.exists?(file)
-                     result = CSV.read(file).find_all do |r|
-                         r[0] == key
-                     end
-     
- 
-                     # return just the single result if theres just one,
-                     # else take all the fields in the csv and build an array
-                     if result.length > 0
-                         if result[0].length == 2
-                             val = result[0][1].to_s
-                             
-                             # parse %{}'s in the CSV into local variables using lookupvar()
-                             while val =~ /%\{(.+?)\}/
-                                 val.gsub!(/%\{#{$1}\}/, lookupvar($1))
-                             end
- 
-                             desired = val
-                         elsif result[0].length > 1
-                             length = result[0].length
-                             cells = result[0][1,length]
-     
-                             # Individual cells in a CSV result are a weird data type and throws
-                             # puppets yaml parsing, so just map it all to plain old strings
-                             desired = cells.map do |c|
-                                 # parse %{}'s in the CSV into local variables using lookupvar()
-                                 while c =~ /%\{(.+?)\}/
-                                     c.gsub!(/%\{#{$1}\}/, lookupvar($1))
-                                 end
- 
-                                 c.to_s
-                             end
-                         end
-                     end
+     datafiles.each do |file|
+       parser.watch_file(file) if File.exists?(file)
+ 
+       if desired == "_ExtUNSET_"
+         if File.exists?(file)
+           result = CSV.read(file).find_all do |r|
+             r[0] == key
+           end
+ 
+ 
+           # return just the single result if theres just one,
+           # else take all the fields in the csv and build an array
+           if result.length > 0
+             if result[0].length == 2
+               val = result[0][1].to_s
+ 
+               # parse %{}'s in the CSV into local variables using lookupvar()
+               while val =~ /%\{(.+?)\}/
+                 val.gsub!(/%\{#{$1}\}/, lookupvar($1))
+               end
+ 
+               desired = val
+             elsif result[0].length > 1
+               length = result[0].length
+               cells = result[0][1,length]
+ 
+               # Individual cells in a CSV result are a weird data type and throws
+               # puppets yaml parsing, so just map it all to plain old strings
+               desired = cells.map do |c|
+                 # parse %{}'s in the CSV into local variables using lookupvar()
+                 while c =~ /%\{(.+?)\}/
+                   c.gsub!(/%\{#{$1}\}/, lookupvar($1))
                  end
-             end
-         end
  
-         # don't accidently return nil's and such rather throw a parse error
-         if desired == "_ExtUNSET_" && default == "_ExtUNSET_"
-             raise Puppet::ParseError, "No match found for '#{key}' in any data file during extlookup()"
-         else 
-             desired = default if desired == "_ExtUNSET_"
+                 c.to_s
+               end
+             end
+           end
          end
+       end
+     end
  
-         desired
+     # don't accidently return nil's and such rather throw a parse error
+     if desired == "_ExtUNSET_" && default == "_ExtUNSET_"
+       raise Puppet::ParseError, "No match found for '#{key}' in any data file during extlookup()"
+     else
+       desired = default if desired == "_ExtUNSET_"
      end
+ 
+     desired
+   end
  end
  
  # vi:tabstop=4:expandtab:ai
diff --combined ext/nagios/naggen
index 2b8480e,a9e04c4..9c4f358
--- a/ext/nagios/naggen
+++ b/ext/nagios/naggen
@@@ -29,7 -29,7 +29,7 @@@
  # just like any other executable.
  #
  # See the configuration file documentation at
 -# http://reductivelabs.com/projects/puppet/reference/configref.html for
 +# http://puppetlabs.com/projects/puppet/reference/configref.html for
  # the full list of acceptable parameters. A commented list of all
  # configuration options can also be generated by running puppet with
  # '--genconfig'.
@@@ -63,7 -63,7 +63,7 @@@
  #
  # = Copyright
  #
 -# Copyright (c) 2009 Reductive Labs, LLC
 +# Copyright (c) 2009 Puppet Labs, LLC
  # Licensed under the GPL 2
  
  require 'puppet'
@@@ -178,7 -178,7 +178,7 @@@ class NagiosWrite
      def initialize(nagios_type)
          @nagios_type = nagios_type
  
-         @bucket = Puppet::Network::Client.client(:Dipper).new(:Path => Puppet[:clientbucketdir])
+         @bucket = Puppet::FileBucket::Dipper.new(:Path => Puppet[:clientbucketdir])
      end
  
      def rails_resources
diff --combined ext/puppet-test
index d1f49d6,61397e7..fce7f3e
--- a/ext/puppet-test
+++ b/ext/puppet-test
@@@ -23,7 -23,7 +23,7 @@@
  # parameter, so you can specify '--server <servername>' as an argument.
  #
  # See the configuration file documentation at
 -# http://reductivelabs.com/projects/puppet/reference/configref.html for
 +# http://puppetlabs.com/projects/puppet/reference/configref.html for
  # the full list of acceptable parameters. A commented list of all
  # configuration $options can also be generated by running puppetd with
  # '--genconfig'.
@@@ -90,7 -90,7 +90,7 @@@
  #
  # = Copyright
  #
 -# Copyright (c) 2005, 2006 Reductive Labs, LLC
 +# Copyright (c) 2005, 2006 Puppet Labs, LLC
  # Licensed under the GNU Public License
  
  # Do an initial trap, so that cancels don't get a stack trace.
@@@ -229,6 -229,30 +229,30 @@@ Suite.new :local_catalog, "Local catalo
      end
  end
  
+ Suite.new :resource_type, "Managing resource types" do
+     newtest :find, "Find a type" do
+         Puppet::Resource::Type.terminus_class = :parser
+         ARGV.each do |name|
+             json = Puppet::Resource::Type.find(name).to_pson
+             data = PSON.parse(json)
+             p Puppet::Resource::Type.from_pson(data)
+         end
+     end
+ 
+     newtest :search_types, "Find all types" do
+         Puppet::Resource::Type.terminus_class = :rest
+         result = Puppet::Resource::Type.search("*")
+         result.each { |r| p r }
+     end
+ 
+     newtest :restful_type, "Find a type and return it via REST" do
+         Puppet::Resource::Type.terminus_class = :rest
+         ARGV.each do |name|
+             p Puppet::Resource::Type.find(name)
+         end
+     end
+ end
+ 
  Suite.new :remote_catalog, "Remote catalog handling" do
      def prepare
          $args[:cache] = false
@@@ -286,7 -310,7 +310,7 @@@ en
  Suite.new :filebucket, "Filebucket interactions" do
      def prepare
          require 'tempfile'
-         @client = Puppet::Network::Client.dipper.new($args)
+         @client = Puppet::FileBucket::Dipper.new($args)
      end
  
      newtest :backup, "Backed up file" do
diff --combined ext/puppetstoredconfigclean.rb
index 6538192,34dd72f..b15496f
--- a/ext/puppetstoredconfigclean.rb
+++ b/ext/puppetstoredconfigclean.rb
@@@ -3,7 -3,7 +3,7 @@@
  # Script to clean up stored configs for (a) given host(s)
  #
  # Credits:
 -# Script was taken from http://reductivelabs.com/trac/puppet/attachment/wiki/UsingStoredConfiguration/kill_node_in_storedconfigs_db.rb
 +# Script was taken from http://puppetlabs.com/trac/puppet/attachment/wiki/UsingStoredConfiguration/kill_node_in_storedconfigs_db.rb
  # which haven been initially posted by James Turnbull
  # duritong adapted and improved the script a bit.
  
@@@ -11,39 -11,42 +11,42 @@@ require 'getoptlong
  config = '/etc/puppet/puppet.conf'
  
  def printusage(error_code)
-     puts "Usage: #{$0} [ list of hostnames as stored in hosts table ]"
-     puts "\n Options:"
-     puts "--config <puppet config file>"
-     exit(error_code)
+   puts "Usage: #{$0} [ list of hostnames as stored in hosts table ]"
+   puts "\n Options:"
+   puts "--config <puppet config file>"
+   exit(error_code)
  end
  
- opts = GetoptLong.new(
-         [ "--config",     "-c",   GetoptLong::REQUIRED_ARGUMENT ],
-         [ "--help",        "-h",   GetoptLong::NO_ARGUMENT ],
-         [ "--usage",       "-u",   GetoptLong::NO_ARGUMENT ],
-         [ "--version",     "-v",   GetoptLong::NO_ARGUMENT ]
+ 
+       opts = GetoptLong.new(
+                 
+     [ "--config",     "-c",   GetoptLong::REQUIRED_ARGUMENT ],
+     [ "--help",        "-h",   GetoptLong::NO_ARGUMENT ],
+     [ "--usage",       "-u",   GetoptLong::NO_ARGUMENT ],
+         
+     [ "--version",     "-v",   GetoptLong::NO_ARGUMENT ]
  )
  
  begin
-     opts.each do |opt, arg|
-         case opt
-         when "--config"
-             config = arg
+   opts.each do |opt, arg|
+     case opt
+     when "--config"
+       config = arg
  
-         when "--help"
-             printusage(0)
+     when "--help"
+       printusage(0)
  
-         when "--usage"
-             printusage(0)
+     when "--usage"
+       printusage(0)
  
-         when "--version"
-             puts "%s" % Puppet.version
-             exit
-         end
+     when "--version"
+       puts "#{Puppet.version}"
+       exit
      end
+   end
  rescue GetoptLong::InvalidOption => detail
-     $stderr.puts "Try '#{$0} --help'"
-     exit(1)
+   $stderr.puts "Try '#{$0} --help'"
+   exit(1)
  end
  
  printusage(1) unless ARGV.size > 0
@@@ -57,17 -60,20 +60,20 @@@ adapter = pm_conf[:dbadapter
  args = {:adapter => adapter, :log_level => pm_conf[:rails_loglevel]}
  
  case adapter
-     when "sqlite3"
-         args[:dbfile] = pm_conf[:dblocation]
-     when "mysql", "postgresql"
-         args[:host]     = pm_conf[:dbserver] unless pm_conf[:dbserver].to_s.empty?
-         args[:username] = pm_conf[:dbuser] unless pm_conf[:dbuser].to_s.empty?
-         args[:password] = pm_conf[:dbpassword] unless pm_conf[:dbpassword].to_s.empty?
-         args[:database] = pm_conf[:dbname] unless pm_conf[:dbname].to_s.empty?
-         socket          = pm_conf[:dbsocket]
-         args[:socket]   = socket unless socket.to_s.empty?
-     else
-         raise ArgumentError, "Invalid db adapter %s" % adapter
+   when "sqlite3"
+     args[:dbfile] = pm_conf[:dblocation]
+   when "mysql", "postgresql"
+     args[:host]     = pm_conf[:dbserver] unless pm_conf[:dbserver].to_s.empty?
+     args[:username] = pm_conf[:dbuser] unless pm_conf[:dbuser].to_s.empty?
+     args[:password] = pm_conf[:dbpassword] unless pm_conf[:dbpassword].to_s.empty?
+     args[:database] = pm_conf[:dbname] unless pm_conf[:dbname].to_s.empty?
+     args[:port]     = pm_conf[:dbport] unless pm_conf[:dbport].to_s.empty?
+     socket          = pm_conf[:dbsocket]
+     args[:socket]   = socket unless socket.to_s.empty?
+     connections     = pm_conf[:dbconnections].to_i
+     args[:pool]     = connections if connections > 0
+   else
+     raise ArgumentError, "Invalid db adapter #{adapter}"
  end
  
  args[:database] = "puppet" unless not args[:database].to_s.empty?
@@@ -75,13 -81,13 +81,13 @@@
  ActiveRecord::Base.establish_connection(args)
  
  ARGV.each { |hostname|
-     if @host = Puppet::Rails::Host.find_by_name(hostname.strip)
-         print "Killing #{hostname}..."
-         $stdout.flush
-         @host.destroy
-         puts "done."
-     else
-         puts "Can't find host #{hostname}."
-     end
+   if @host = Puppet::Rails::Host.find_by_name(hostname.strip)
+     print "Killing #{hostname}..."
+     $stdout.flush
+     @host.destroy
+     puts "done."
+   else
+     puts "Can't find host #{hostname}."
+   end
  }
  exit 0
diff --combined man/man5/puppet.conf.5
index ff9b889,2a5b1b1..dfa4e03
--- a/man/man5/puppet.conf.5
+++ b/man/man5/puppet.conf.5
@@@ -418,6 -418,11 +418,11 @@@ The type of database to use
  .
  \fBDefault\fP: sqlite3
  .UNINDENT
+ 
+ .SS dbconnections
+ The number of database connections. Only used when networked databases are used.  Will be ignored if the value is an empty string or is less than 1.
+ 
+ 
  .SS dblocation
  .sp
  The database cache for client configurations.  Used for querying within the language.
@@@ -738,7 -743,7 +743,7 @@@ The LDAP attributes to use to define Pu
  .UNINDENT
  .SS ldapnodes
  .sp
 -Whether to search for node configurations in LDAP.  See \fI\%http://reductivelabs.com/trac/puppet/wiki/LDAPNodes\fP for more information.
 +Whether to search for node configurations in LDAP.  See \fI\%http://puppetlabs.com/trac/puppet/wiki/LDAPNodes\fP for more information.
  .INDENT 0.0
  .IP \(bu 2
  .
@@@ -1310,7 -1315,7 +1315,7 @@@ The maximum time to delay before runs
  .UNINDENT
  .SS ssl_client_header
  .sp
 -The header containing an authenticated client\(aqs SSL DN.  Only used with Mongrel.  This header must be set by the proxy to the authenticated client\(aqs SSL DN (e.g., \fB/CN=puppet.reductivelabs.com\fP). See \fI\%http://reductivelabs.com/puppet/trac/wiki/UsingMongrel\fP for more information.
 +The header containing an authenticated client\(aqs SSL DN.  Only used with Mongrel.  This header must be set by the proxy to the authenticated client\(aqs SSL DN (e.g., \fB/CN=puppet.puppetlabs.com\fP). See \fI\%http://puppetlabs.com/puppet/trac/wiki/UsingMongrel\fP for more information.
  .INDENT 0.0
  .IP \(bu 2
  .
@@@ -1318,7 -1323,7 +1323,7 @@@
  .UNINDENT
  .SS ssl_client_verify_header
  .sp
 -The header containing the status message of the client verification. Only used with Mongrel.  This header must be set by the proxy to \(aqSUCCESS\(aq if the client successfully authenticated, and anything else otherwise. See \fI\%http://reductivelabs.com/puppet/trac/wiki/UsingMongrel\fP for more information.
 +The header containing the status message of the client verification. Only used with Mongrel.  This header must be set by the proxy to \(aqSUCCESS\(aq if the client successfully authenticated, and anything else otherwise. See \fI\%http://puppetlabs.com/puppet/trac/wiki/UsingMongrel\fP for more information.
  .INDENT 0.0
  .IP \(bu 2
  .

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list