diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-31 15:05:54 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-31 15:26:41 -0700 |
commit | dd8108cd8f48d399ab728c3437e3fef38f0eb46c (patch) | |
tree | f3ce0372912fbd42221580599c98a9427a359006 | |
parent | 618495c7b70671ff1da1653c76d1524ff3f615b7 (diff) | |
download | puppet-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.rb | 2 |
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 |