diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-06-01 11:53:40 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-06-01 11:53:40 -0700 |
commit | 796900b04e234b61a77fe4b64c006f24e15a7360 (patch) | |
tree | 43d4af311ea97c19fa8518ab44f004f512851950 /lib/puppet/interface/action_manager.rb | |
parent | 0370011a95d90ce0ff6ee7277d96021b3f3c8744 (diff) | |
download | puppet-796900b04e234b61a77fe4b64c006f24e15a7360.tar.gz puppet-796900b04e234b61a77fe4b64c006f24e15a7360.tar.xz puppet-796900b04e234b61a77fe4b64c006f24e15a7360.zip |
(#7699) Don't duplicate inherited action names on faces.
We earlier moved to duplicating Action objects in the Faces subsystem to
ensure they had the correct binding context during execution and introspection.
This was correct, but introduced a bug where we would report both the parent
and child binding as separate entries with duplicate names, in the list of
actions.
This flowed on to the help output, where it would cause every inherited action
to be listed twice: once on the parent, once on the child. (This was actually
worse if the inheritance was deeper: we would duplicate once for every level
between the instance and the origin of the action.)
Diffstat (limited to 'lib/puppet/interface/action_manager.rb')
-rw-r--r-- | lib/puppet/interface/action_manager.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/interface/action_manager.rb b/lib/puppet/interface/action_manager.rb index c5eb8e08a..fbf588d7d 100644 --- a/lib/puppet/interface/action_manager.rb +++ b/lib/puppet/interface/action_manager.rb @@ -34,7 +34,10 @@ module Puppet::Interface::ActionManager elsif self.class.respond_to?(:actions) result += self.class.actions end - result.sort + # We need to uniq the result, because we duplicate actions when they are + # fetched to ensure that they have the correct bindings; they shadow the + # parent, and uniq implements that. --daniel 2011-06-01 + result.uniq.sort end def get_action(name) |