diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-17 19:28:07 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-19 10:33:25 -0700 |
commit | 4efba7148a79fcd099b4eb9bd17cbb2d785f5fb8 (patch) | |
tree | b7293d76a4b032088ac020a0ae8e13c8c502f1d9 /lib/puppet/interface.rb | |
parent | 266f937ed7d859fb2aee94c76e1a20539357c1eb (diff) | |
download | puppet-4efba7148a79fcd099b4eb9bd17cbb2d785f5fb8.tar.gz puppet-4efba7148a79fcd099b4eb9bd17cbb2d785f5fb8.tar.xz puppet-4efba7148a79fcd099b4eb9bd17cbb2d785f5fb8.zip |
maint: drop multi-version support from action loading.
Right now we have no other support for multi-version loading in the code; we
should strip out support from the action loading to mirror.
Reviewed-By: Max Martin <max@puppetlabs.com>
Diffstat (limited to 'lib/puppet/interface.rb')
-rw-r--r-- | lib/puppet/interface.rb | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/lib/puppet/interface.rb b/lib/puppet/interface.rb index d97e462de..888e4ecad 100644 --- a/lib/puppet/interface.rb +++ b/lib/puppet/interface.rb @@ -109,26 +109,11 @@ class Puppet::Interface # Try to find actions defined in other files. def load_actions - path = "puppet/face/#{name}" - - loaded = [] - [path, "#{name}@#{version}/#{path}"].each do |path| - Puppet::Interface.autoloader.search_directories.each do |dir| - fdir = ::File.join(dir, path) - next unless FileTest.directory?(fdir) - - 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 "#{Dir.pwd}/#{aname}" - end - end + Puppet::Interface.autoloader.search_directories.each do |dir| + Dir.glob(File.join(dir, "puppet/face/#{name}", "*.rb")).each do |file| + action = file.sub(dir, '').sub(/^[\\\/]/, '').sub(/\.rb/, '') + Puppet.debug "Loading action '#{action}' for '#{name}' from '#{dir}/#{action}.rb'" + require(action) end end end |