diff options
| author | Pieter van de Bruggen <pieter@puppetlabs.com> | 2011-03-23 13:59:44 -0700 |
|---|---|---|
| committer | Pieter van de Bruggen <pieter@puppetlabs.com> | 2011-03-23 13:59:44 -0700 |
| commit | 1187a0eb2550f04d9b6c3dcfdcacdfbb32de0e56 (patch) | |
| tree | bfa547837e6112bfd274f16941461b942aa19f43 /lib/puppet/application | |
| parent | f7db67513cace1efaf054406dae040dab2c44efd (diff) | |
| download | puppet-1187a0eb2550f04d9b6c3dcfdcacdfbb32de0e56.tar.gz puppet-1187a0eb2550f04d9b6c3dcfdcacdfbb32de0e56.tar.xz puppet-1187a0eb2550f04d9b6c3dcfdcacdfbb32de0e56.zip | |
(#6770) Add basic versioning for interfaces.
Reviewed-By: Nick Lewis
Diffstat (limited to 'lib/puppet/application')
| -rw-r--r-- | lib/puppet/application/configurer.rb | 4 | ||||
| -rw-r--r-- | lib/puppet/application/interface.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/application/interface_base.rb | 7 |
3 files changed, 7 insertions, 6 deletions
diff --git a/lib/puppet/application/configurer.rb b/lib/puppet/application/configurer.rb index 378364430..a76aaaf01 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.interface(:configurer).synchronize(Puppet[:certname]) - Puppet::Interface.interface(:report).submit(report) + report = Puppet::Interface.interface(:configurer, 1).synchronize(Puppet[:certname]) + Puppet::Interface.interface(:report, 1).submit(report) end end diff --git a/lib/puppet/application/interface.rb b/lib/puppet/application/interface.rb index 10823e920..99c10dc16 100644 --- a/lib/puppet/application/interface.rb +++ b/lib/puppet/application/interface.rb @@ -81,7 +81,7 @@ class Puppet::Application::Interface < Puppet::Application end def actions(indirection) - return [] unless interface = Puppet::Interface.interface(indirection) + return [] unless interface = Puppet::Interface.interface(indirection, 1) interface.load_actions return interface.actions.sort { |a,b| a.to_s <=> b.to_s } end diff --git a/lib/puppet/application/interface_base.rb b/lib/puppet/application/interface_base.rb index 7a31ce323..78772833e 100644 --- a/lib/puppet/application/interface_base.rb +++ b/lib/puppet/application/interface_base.rb @@ -71,10 +71,11 @@ class Puppet::Application::InterfaceBase < Puppet::Application @type = self.class.name.to_s.sub(/.+:/, '').downcase.to_sym - unless Puppet::Interface.interface?(@type) - raise "Could not find interface '#{@type}'" + # TODO: These should be configurable versions. + unless Puppet::Interface.interface?(@type, 1) + raise "Could not find version #{1} of interface '#{@type}'" end - @interface = Puppet::Interface.interface(@type) + @interface = Puppet::Interface.interface(@type, 1) @format ||= @interface.default_format # We copy all of the app options to the interface. |
