summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2010-03-24 19:38:43 -0700
committerJames Turnbull <james@lovedthanlost.net>2010-03-26 12:22:59 +1100
commitba43d7b217615dba18a709e7b7353234671e9891 (patch)
treef6b061c8d340cd7971dc8dcb2a4c4530ad78f085 /lib/puppet
parent5ab5e8a00648569686c5259862c865c5db8da83a (diff)
downloadpuppet-ba43d7b217615dba18a709e7b7353234671e9891.tar.gz
puppet-ba43d7b217615dba18a709e7b7353234671e9891.tar.xz
puppet-ba43d7b217615dba18a709e7b7353234671e9891.zip
Fix for #3366 - --tags '' treated as boolean 'true'
This is the patch from Mike Pountney <Mike.Pountney@gmail.com> off the list with the additional test Luke requested.
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/util/settings.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb
index 532fce960..002bc0b1a 100644
--- a/lib/puppet/util/settings.rb
+++ b/lib/puppet/util/settings.rb
@@ -147,6 +147,7 @@ class Puppet::Util::Settings
@cache.clear
value = munge_value(value) if value
str = opt.sub(/^--/,'')
+
bool = true
newstr = str.sub(/^no-/, '')
if newstr != str
@@ -155,8 +156,10 @@ class Puppet::Util::Settings
end
str = str.intern
- if value == "" or value.nil?
- value = bool
+ if @config[str].is_a?(Puppet::Util::Settings::BooleanSetting)
+ if value == "" or value.nil?
+ value = bool
+ end
end
set_value(str, value, :cli)