[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:07:27 UTC 2011
The following commit has been merged in the experimental branch:
commit 562ae5fb9d78b1a6d46e79bb41d8498f29246f41
Author: Luke Kanies <luke at puppetlabs.com>
Date: Tue Mar 22 19:10:35 2011 -0700
WIP - all tests fail
Signed-off-by: Luke Kanies <luke at puppetlabs.com>
diff --git a/lib/puppet/interface/action_manager.rb b/lib/puppet/interface/action_manager.rb
index 8629b4c..0db82d6 100644
--- a/lib/puppet/interface/action_manager.rb
+++ b/lib/puppet/interface/action_manager.rb
@@ -31,6 +31,6 @@ module Puppet::Interface::ActionManager
end
def action?(name)
- actions.include?(name)
+ actions.include?(name.to_sym)
end
end
diff --git a/lib/puppet/interface/certificate.rb b/lib/puppet/interface/certificate.rb
index 32415ea..9b94969 100644
--- a/lib/puppet/interface/certificate.rb
+++ b/lib/puppet/interface/certificate.rb
@@ -1,20 +1,20 @@
require 'puppet/interface/indirector'
Puppet::Interface::Indirector.interface(:certificate) do
-
action :sign do |name|
- unless indirection.terminus
- raise ArgumentError, "You must have a CA specified; use --ca-location to specify the location (remote, local, only)"
- end
+ invoke do |name|
+ unless Puppet::SSL::Host.ca_location
+ raise ArgumentError, "You must have a CA location specified; use --ca-location to specify the location (remote, local, only)"
+ end
- location = Puppet::SSL::Host.ca_location
- if location == :local && !Puppet::SSL::CertificateAuthority.ca?
- Puppet::Application[:certificate].class.run_mode("master")
- set_run_mode Puppet::Application[:certificate].class.run_mode
- end
+ location = Puppet::SSL::Host.ca_location
+ if location == :local && !Puppet::SSL::CertificateAuthority.ca?
+ Puppet::Application[:certificate].class.run_mode("master")
+ set_run_mode Puppet::Application[:certificate].class.run_mode
+ end
- Puppet::SSL::Host.indirection.save(Puppet::SSL::Host.new(name))
+ Puppet::SSL::Host.indirection.save(Puppet::SSL::Host.new(name))
+ end
end
-
end
diff --git a/spec/unit/interface/action_manager_spec.rb b/spec/unit/interface/action_manager_spec.rb
index bf101b3..d1a7e31 100644
--- a/spec/unit/interface/action_manager_spec.rb
+++ b/spec/unit/interface/action_manager_spec.rb
@@ -38,6 +38,14 @@ describe Puppet::Interface::ActionManager do
subject.should be_action(:foo)
end
+
+ it "should correctly treat action names specified as strings" do
+ subject.action(:foo) do
+ invoke { "something" }
+ end
+
+ subject.should be_action("foo")
+ end
end
describe "when used to extend a class" do
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list