summaryrefslogtreecommitdiffstats
path: root/lib/puppet/interface.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2011-02-08 16:24:30 -0800
committerLuke Kanies <luke@puppetlabs.com>2011-02-08 16:24:30 -0800
commitefca35cbea836fac954fb655d76493f03b36e96f (patch)
treebead559fb4a20391cac95a0ff650b7ef24ceb561 /lib/puppet/interface.rb
parent025768fc69de268b3c01526a138f54dc5778b9c8 (diff)
downloadpuppet-efca35cbea836fac954fb655d76493f03b36e96f.tar.gz
puppet-efca35cbea836fac954fb655d76493f03b36e96f.tar.xz
puppet-efca35cbea836fac954fb655d76493f03b36e96f.zip
Finishing migration from puppet repo
The whole system seems to work again, as long as you run it against 2.6.next. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'lib/puppet/interface.rb')
-rw-r--r--lib/puppet/interface.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/puppet/interface.rb b/lib/puppet/interface.rb
index 2be3df5d6..6e132f645 100644
--- a/lib/puppet/interface.rb
+++ b/lib/puppet/interface.rb
@@ -47,6 +47,21 @@ class Puppet::Interface
Kernel::exit(1)
end
+ # Try to find actions defined in other files.
+ def self.load_actions
+ path = "puppet/interface/#{name}"
+
+ autoloader.search_directories.each do |dir|
+ fdir = File.join(dir, path)
+ next unless FileTest.directory?(fdir)
+
+ Dir.glob("#{fdir}/*.rb").each do |file|
+ Puppet.info "Loading actions for '#{name}' from '#{file}'"
+ require file
+ end
+ end
+ end
+
# Return the interface name.
def self.name
@name || self.to_s.sub(/.+::/, '').downcase
@@ -94,7 +109,7 @@ class Puppet::Interface
Puppet::Util::Log.newdestination :console
- load_actions
+ self.class.load_actions
end
def set_terminus(from)
@@ -114,27 +129,12 @@ class Puppet::Interface
end
unless result
- raise "Could not #{verb} #{type} for #{name}"
+ raise "Could not #{method} #{indirection.name} for #{name}"
end
puts result.render(format.to_sym)
end
- # Try to find actions defined in other files.
- def load_actions
- path = "puppet/interface/#{self.class.name}"
-
- self.class.autoloader.search_directories.each do |dir|
- fdir = File.join(dir, path)
- next unless FileTest.directory?(fdir)
-
- Dir.glob("#{fdir}/*.rb").each do |file|
- Puppet.info "Loading actions for '#{self.class.name}' from '#{file}'"
- require file
- end
- end
- end
-
def indirections
Puppet::Indirector::Indirection.instances.collect { |t| t.to_s }.sort
end