summaryrefslogtreecommitdiffstats
path: root/lib/puppet/application/interface.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2011-02-22 23:04:45 -0800
committerLuke Kanies <luke@puppetlabs.com>2011-02-22 23:04:45 -0800
commitbec807e5a12e24c11aedb40a997b154f1bed62c0 (patch)
treed148005c4339498688116052ffaedc658efccaeb /lib/puppet/application/interface.rb
parent368210e8a8a35cf2cae509b1d357337f9958cdff (diff)
downloadpuppet-bec807e5a12e24c11aedb40a997b154f1bed62c0.tar.gz
puppet-bec807e5a12e24c11aedb40a997b154f1bed62c0.tar.xz
puppet-bec807e5a12e24c11aedb40a997b154f1bed62c0.zip
Fixing 'puppet interface list'
Also added a test to hopefully confirm it won't break again. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'lib/puppet/application/interface.rb')
-rw-r--r--lib/puppet/application/interface.rb30
1 files changed, 4 insertions, 26 deletions
diff --git a/lib/puppet/application/interface.rb b/lib/puppet/application/interface.rb
index 8f26658c9..10823e920 100644
--- a/lib/puppet/application/interface.rb
+++ b/lib/puppet/application/interface.rb
@@ -1,4 +1,5 @@
require 'puppet/application'
+require 'puppet/interface'
class Puppet::Application::Interface < Puppet::Application
@@ -24,6 +25,7 @@ class Puppet::Application::Interface < Puppet::Application
terms = terminus_classes(name.to_sym)
str << "\tTerminuses: #{terms.join(", ")}\n"
rescue => detail
+ puts detail.backtrace if Puppet[:trace]
$stderr.puts "Could not load terminuses for #{name}: #{detail}"
end
end
@@ -33,13 +35,13 @@ class Puppet::Application::Interface < Puppet::Application
actions = actions(name.to_sym)
str << "\tActions: #{actions.join(", ")}\n"
rescue => detail
+ puts detail.backtrace if Puppet[:trace]
$stderr.puts "Could not load actions for #{name}: #{detail}"
end
end
print str
end
- exit(0)
end
attr_accessor :verb, :name, :arguments
@@ -71,31 +73,7 @@ class Puppet::Application::Interface < Puppet::Application
end
def interfaces
- # Load all of the interfaces
- unless @interfaces
- $LOAD_PATH.each do |dir|
- next unless FileTest.directory?(dir)
- Dir.chdir(dir) do
- Dir.glob("puppet/interface/*.rb").collect { |f| f.sub(/\.rb/, '') }.each do |file|
- begin
- require file
- rescue Error => detail
- puts detail.backtrace if Puppet[:trace]
- raise "Could not load #{file}: #{detail}"
- end
- end
- end
- end
-
- @interfaces = []
- Puppet::Interface.constants.each do |name|
- klass = Puppet::Interface.const_get(name)
- next if klass.abstract? # skip base classes
-
- @interfaces << name.downcase
- end
- end
- @interfaces
+ Puppet::Interface.interfaces
end
def terminus_classes(indirection)