[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5
Luke Kanies
luke at puppetlabs.com
Tue May 10 08:05:34 UTC 2011
The following commit has been merged in the experimental branch:
commit 63263a41ab361985845ef514a3d1247a41f46475
Author: Luke Kanies <luke at puppetlabs.com>
Date: Wed Mar 2 17:19:36 2011 -0800
Fixing #13 - showconfig moved to indirector
I renamed it to 'info', too.
It only showed indirector-related info, so this
makes sense.
Signed-off-by: Luke Kanies <luke at puppetlabs.com>
diff --git a/lib/puppet/interface.rb b/lib/puppet/interface.rb
index 1dfb34c..476de8b 100644
--- a/lib/puppet/interface.rb
+++ b/lib/puppet/interface.rb
@@ -82,15 +82,6 @@ class Puppet::Interface
attr_accessor :type, :verb, :name, :arguments, :options
- # Print the configuration for the current terminus class
- action :showconfig do |*args|
- if t = indirection.terminus_class
- puts "Run mode #{Puppet.run_mode}: #{t}"
- else
- $stderr.puts "No default terminus class for run mode #{Puppet.run_mode}"
- end
- end
-
def initialize(name, options = {}, &block)
@name = name
diff --git a/lib/puppet/interface/indirector.rb b/lib/puppet/interface/indirector.rb
index f106db4..9c26cc3 100644
--- a/lib/puppet/interface/indirector.rb
+++ b/lib/puppet/interface/indirector.rb
@@ -26,6 +26,15 @@ class Puppet::Interface::Indirector < Puppet::Interface
call_indirection_method(:search, *args)
end
+ # Print the configuration for the current terminus class
+ action :info do |*args|
+ if t = indirection.terminus_class
+ puts "Run mode '#{Puppet.run_mode.name}': #{t}"
+ else
+ $stderr.puts "No default terminus class for run mode '#{Puppet.run_mode.name}'"
+ end
+ end
+
attr_accessor :from
def indirection_name
diff --git a/spec/unit/interface/indirector_spec.rb b/spec/unit/interface/indirector_spec.rb
index 645c599..c0b738c 100644
--- a/spec/unit/interface/indirector_spec.rb
+++ b/spec/unit/interface/indirector_spec.rb
@@ -45,15 +45,19 @@ describe Puppet::Interface::Indirector do
@instance.indirection.expects(method).with(:test, "myargs")
@instance.send(method, :test, "myargs")
end
+ end
- it "should be able to override its indirection name" do
- @instance.set_indirection_name :foo
- @instance.indirection_name.should == :foo
- end
+ it "should be able to override its indirection name" do
+ @instance.set_indirection_name :foo
+ @instance.indirection_name.should == :foo
+ end
- it "should be able to set its terminus class" do
- @instance.indirection.expects(:terminus_class=).with(:myterm)
- @instance.set_terminus(:myterm)
- end
+ it "should be able to set its terminus class" do
+ @instance.indirection.expects(:terminus_class=).with(:myterm)
+ @instance.set_terminus(:myterm)
+ end
+
+ it "should define a class-level 'info' action" do
+ Puppet::Interface::Indirector.should be_action(:info)
end
end
diff --git a/spec/unit/interface_spec.rb b/spec/unit/interface_spec.rb
index 774c0bd..8799d6b 100644
--- a/spec/unit/interface_spec.rb
+++ b/spec/unit/interface_spec.rb
@@ -50,10 +50,6 @@ describe Puppet::Interface do
Puppet::Interface.autoloader.should be_instance_of(Puppet::Util::Autoload)
end
- it "should define a class-level 'showconfig' action" do
- Puppet::Interface.should be_action(:showconfig)
- end
-
it "should set any provided options" do
Puppet::Interface.new(:me, :verb => "foo").verb.should == "foo"
end
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list