summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-05-31 15:05:54 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-05-31 15:26:41 -0700
commitdd8108cd8f48d399ab728c3437e3fef38f0eb46c (patch)
treef3ce0372912fbd42221580599c98a9427a359006
parent618495c7b70671ff1da1653c76d1524ff3f615b7 (diff)
downloadpuppet-dd8108cd8f48d399ab728c3437e3fef38f0eb46c.tar.gz
puppet-dd8108cd8f48d399ab728c3437e3fef38f0eb46c.tar.xz
puppet-dd8108cd8f48d399ab728c3437e3fef38f0eb46c.zip
#7211: nasty logic error with global Face options taking arguments.
A logic error meant that global Face options that took arguments were mishandled: we never consumed the argument, so we read this: puppet facts --render-as json find $(hostname) ...as meaning "invoke the 'json' action on the 'facts' face"... This fixes that problem, so we now correctly handle both optional and non-optional arguments to global Face options.
-rw-r--r--lib/puppet/application/face_base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/application/face_base.rb b/lib/puppet/application/face_base.rb
index 2f07faae1..ea5ba4aaf 100644
--- a/lib/puppet/application/face_base.rb
+++ b/lib/puppet/application/face_base.rb
@@ -91,7 +91,7 @@ class Puppet::Application::FaceBase < Puppet::Application
index += 1 # ...so skip the argument.
end
elsif option = find_application_argument(item) then
- index += 1 if (option[:argument] and option[:optional])
+ index += 1 if (option[:argument] and not option[:optional])
else
raise OptionParser::InvalidOption.new(item.sub(/=.*$/, ''))
end