summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-08-04 00:36:47 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-08-04 00:36:47 +0000
commit40e4d6fa02e801a26c2880840befa32718e55452 (patch)
tree893496547abebfd805e4b28e4ba13f443c66e897 /lib/puppet
parent97cd057177f18a0e6694aab0e440f86e0bf08d42 (diff)
downloadpuppet-40e4d6fa02e801a26c2880840befa32718e55452.tar.gz
puppet-40e4d6fa02e801a26c2880840befa32718e55452.tar.xz
puppet-40e4d6fa02e801a26c2880840befa32718e55452.zip
Fixing #735 -- gen_config now uses a single heading, matching the name of the process
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2743 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/reference/configuration.rb11
-rw-r--r--lib/puppet/util/config.rb5
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/puppet/reference/configuration.rb b/lib/puppet/reference/configuration.rb
index b83992290..65fdbeb7d 100644
--- a/lib/puppet/reference/configuration.rb
+++ b/lib/puppet/reference/configuration.rb
@@ -109,11 +109,14 @@ the executable in question with the `--genconfig` command. The executable
will print a template configuration to standard output, which can be
redirected to a file like so::
- $ puppetd --genconfig > /etc/puppet/puppetd.conf
+ $ puppetd --genconfig > /etc/puppet/puppet.conf
-Note that this invocation will \"clobber\" (throw away) the contents of any
-pre-existing `puppetd.conf` file, so make a backup of your present config
-if it contains valuable information.
+Note that this invocation will replace the contents of any pre-existing
+`puppet.conf` file, so make a backup of your present config if it contains
+valuable information.
+
+All parameters will be under a single section heading matching the name of
+the process used to generate the configuraiton ('puppetd', in this case).
Like the `--genconfig` argument, the executables also accept a `--genmanifest`
argument, which will generate a manifest that can be used to manage all of
diff --git a/lib/puppet/util/config.rb b/lib/puppet/util/config.rb
index ded78f9c4..6d42f0ea6 100644
--- a/lib/puppet/util/config.rb
+++ b/lib/puppet/util/config.rb
@@ -541,8 +541,11 @@ Generated on #{Time.now}.
}.gsub(/^/, "# ")
+ # Add a section heading that matches our name.
+ if @config.include?(:name)
+ str += "[%s]\n" % self[:name]
+ end
eachsection do |section|
- str += "[#{section}]\n"
persection(section) do |obj|
str += obj.to_config + "\n"
end