summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2011-02-24 10:24:08 -0800
committerLuke Kanies <luke@puppetlabs.com>2011-02-24 10:24:08 -0800
commit66c994ac43347c735f0ea4158b38557d32ec5747 (patch)
tree7c41bf1d881c257be7b75e948640391b032812c6 /lib
parent21b541d6ca4b1b76a4e0cd525fa66192c0857a5e (diff)
downloadpuppet-66c994ac43347c735f0ea4158b38557d32ec5747.tar.gz
puppet-66c994ac43347c735f0ea4158b38557d32ec5747.tar.xz
puppet-66c994ac43347c735f0ea4158b38557d32ec5747.zip
Attempting to skip loading of duplicate actions
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/interface.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/puppet/interface.rb b/lib/puppet/interface.rb
index 3fb61c8a8..1dfb34cf3 100644
--- a/lib/puppet/interface.rb
+++ b/lib/puppet/interface.rb
@@ -114,6 +114,7 @@ class Puppet::Interface
def load_actions
path = "puppet/interface/#{name}"
+ loaded = []
self.class.autoloader.search_directories.each do |dir|
fdir = ::File.join(dir, path)
next unless FileTest.directory?(fdir)
@@ -121,6 +122,11 @@ class Puppet::Interface
Dir.chdir(fdir) do
Dir.glob("*.rb").each do |file|
aname = file.sub(/\.rb/, '')
+ if loaded.include?(aname)
+ Puppet.debug "Not loading duplicate action '#{aname}' for '#{name}' from '#{fdir}/#{file}'"
+ next
+ end
+ loaded << aname
Puppet.debug "Loading action '#{aname}' for '#{name}' from '#{fdir}/#{file}'"
require "#{path}/#{aname}"
end