diff options
| author | Pieter van de Bruggen <pieter@puppetlabs.com> | 2011-03-22 13:19:25 -0700 |
|---|---|---|
| committer | Pieter van de Bruggen <pieter@puppetlabs.com> | 2011-03-22 14:05:47 -0700 |
| commit | a58bf959ec49c033e0498916a09e77e303c5792e (patch) | |
| tree | 5f0a049580cc9d2a7fe568c3fd9c1cef312ac841 /lib/puppet/application | |
| parent | 45613e0f192778cd16f945d5d1eb109e6c8dee2d (diff) | |
(#6786) Change interface storage and access.
Ruby's namespace mechanism introduced a number of problems, including
incorrect name resolution for common and simple cases. Given that,
we've refactored back to class-level data structures with accessor
methods available.
The current method names are unlikely to be the final UI.
Reviewed-By: Daniel Pittman
Diffstat (limited to 'lib/puppet/application')
| -rw-r--r-- | lib/puppet/application/configurer.rb | 4 | ||||
| -rw-r--r-- | lib/puppet/application/interface_base.rb | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/puppet/application/configurer.rb b/lib/puppet/application/configurer.rb index 70d24814e..378364430 100644 --- a/lib/puppet/application/configurer.rb +++ b/lib/puppet/application/configurer.rb @@ -17,7 +17,7 @@ class Puppet::Application::Configurer < Puppet::Application end def run_command - report = Puppet::Interface::Configurer.synchronize(Puppet[:certname]) - Puppet::Interface::Report.submit(report) + report = Puppet::Interface.interface(:configurer).synchronize(Puppet[:certname]) + Puppet::Interface.interface(:report).submit(report) end end diff --git a/lib/puppet/application/interface_base.rb b/lib/puppet/application/interface_base.rb index f2c147f1f..654674df5 100644 --- a/lib/puppet/application/interface_base.rb +++ b/lib/puppet/application/interface_base.rb @@ -75,9 +75,10 @@ class Puppet::Application::InterfaceBase < Puppet::Application @type = self.class.name.to_s.sub(/.+:/, '').downcase.to_sym - unless @interface = Puppet::Interface.const_get(@type) + unless Puppet::Interface.interface?(@type) raise "Could not find interface '#{@type}'" end + @interface = Puppet::Interface.interface(@type) @format ||= @interface.default_format # We copy all of the app options to the interface. |
