summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/config.rb8
-rwxr-xr-xtest/other/config.rb21
2 files changed, 29 insertions, 0 deletions
diff --git a/lib/puppet/config.rb b/lib/puppet/config.rb
index ff1494ea8..4fb2840b7 100644
--- a/lib/puppet/config.rb
+++ b/lib/puppet/config.rb
@@ -222,6 +222,14 @@ class Config
values[section] = {}
end
values[section][var.to_s] = value
+
+ # Do some annoying skullduggery here. This is so that
+ # the group can be set in the config file. The problem
+ # is that we're using the word 'group' twice, which is
+ # confusing.
+ if var == :group and section == Puppet.name and @config.include?(:group)
+ @config[:group].value = value
+ end
next
end
diff --git a/test/other/config.rb b/test/other/config.rb
index b404f93ad..62a308040 100755
--- a/test/other/config.rb
+++ b/test/other/config.rb
@@ -496,6 +496,27 @@ yay = /a/path
assert(! Puppet.type(:file)["/dev/testing"], "Created dev file")
end
+
+ def test_groupsetting
+ cfile = tempfile()
+
+ group = "yayness"
+
+ File.open(cfile, "w") do |f|
+ f.puts "[#{Puppet.name}]
+ group = #{group}
+ "
+ end
+
+ config = mkconfig
+ config.setdefaults(Puppet.name, :group => ["puppet", "a group"])
+
+ assert_nothing_raised {
+ config.parse(cfile)
+ }
+
+ assert_equal(group, config[:group], "Group did not take")
+ end
end
# $Id$