From 796900b04e234b61a77fe4b64c006f24e15a7360 Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Wed, 1 Jun 2011 11:53:40 -0700 Subject: (#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.) --- lib/puppet/interface/action_manager.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/puppet/interface/action_manager.rb') 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) -- cgit