diff options
author | Luke Kanies <luke@puppetlabs.com> | 2011-02-24 08:34:24 -0800 |
---|---|---|
committer | Luke Kanies <luke@puppetlabs.com> | 2011-02-24 08:34:24 -0800 |
commit | 21b541d6ca4b1b76a4e0cd525fa66192c0857a5e (patch) | |
tree | 09f30aea45f73f3bd11a59e38eefd76900266416 /lib/puppet/application | |
parent | 59a648502a8f09948bd2d25a72a9099f7740e108 (diff) | |
download | puppet-21b541d6ca4b1b76a4e0cd525fa66192c0857a5e.tar.gz puppet-21b541d6ca4b1b76a4e0cd525fa66192c0857a5e.tar.xz puppet-21b541d6ca4b1b76a4e0cd525fa66192c0857a5e.zip |
Fixing plugin usage
I had broken some usages of plugins by incorrectly
selecting command-line arguments. The fix was
to remove the #main method contained in the
IndirectionBase subclass.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'lib/puppet/application')
-rw-r--r-- | lib/puppet/application/indirection_base.rb | 7 | ||||
-rw-r--r-- | lib/puppet/application/interface_base.rb | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/lib/puppet/application/indirection_base.rb b/lib/puppet/application/indirection_base.rb index 3e907696e..e6d172ced 100644 --- a/lib/puppet/application/indirection_base.rb +++ b/lib/puppet/application/indirection_base.rb @@ -8,13 +8,6 @@ class Puppet::Application::IndirectionBase < Puppet::Application::InterfaceBase attr_accessor :from, :indirection - def main - # Call the method associated with the provided action (e.g., 'find'). - result = interface.send(verb, name, *arguments) - render_method = Puppet::Network::FormatHandler.format(format).render_method - puts result.send(render_method) if result - end - def setup super diff --git a/lib/puppet/application/interface_base.rb b/lib/puppet/application/interface_base.rb index 044249d39..70022f17d 100644 --- a/lib/puppet/application/interface_base.rb +++ b/lib/puppet/application/interface_base.rb @@ -61,6 +61,8 @@ class Puppet::Application::InterfaceBase < Puppet::Application @verb, @arguments = command_line.args @arguments ||= [] + @arguments = Array(@arguments) + @type = self.class.name.to_s.sub(/.+:/, '').downcase.to_sym unless @interface = Puppet::Interface.interface(@type) |