[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35
test branch
puppet-dev at googlegroups.com
Wed Jul 14 10:33:15 UTC 2010
The following commit has been merged in the upstream branch:
commit 6bdda8c65e55fcdab896cee9985bca3593c66c95
Author: Jesse Wolfe <jes5199 at gmail.com>
Date: Tue Apr 20 14:15:06 2010 -0700
feature #2276 Single Executable: "puppet cert"
Add "puppet cert" as the new invocation of "puppetca"
Signed-off-by: Jesse Wolfe <jes5199 at gmail.com>
diff --git a/lib/puppet/application/ca.rb b/lib/puppet/application/cert.rb
similarity index 98%
rename from lib/puppet/application/ca.rb
rename to lib/puppet/application/cert.rb
index ab7f607..f48e530 100644
--- a/lib/puppet/application/ca.rb
+++ b/lib/puppet/application/cert.rb
@@ -2,7 +2,7 @@ require 'puppet'
require 'puppet/application'
require 'puppet/ssl/certificate_authority'
-Puppet::Application.new(:ca) do
+Puppet::Application.new(:cert) do
should_parse_config
diff --git a/sbin/puppetca b/sbin/puppetca
index 71cb6c9..ce2e315 100755
--- a/sbin/puppetca
+++ b/sbin/puppetca
@@ -107,5 +107,5 @@
# Copyright (c) 2005 Reductive Labs, LLC
# Licensed under the GNU Public License
-require 'puppet/application/ca'
-Puppet::Application[:ca].run
+require 'puppet/application/cert'
+Puppet::Application[:cert].run
diff --git a/spec/unit/application/ca.rb b/spec/unit/application/cert.rb
similarity index 73%
rename from spec/unit/application/ca.rb
rename to spec/unit/application/cert.rb
index 8432e65..a777a8c 100644
--- a/spec/unit/application/ca.rb
+++ b/spec/unit/application/cert.rb
@@ -2,26 +2,26 @@
require File.dirname(__FILE__) + '/../../spec_helper'
-require 'puppet/application/ca'
+require 'puppet/application/cert'
describe "PuppetCA" do
before :each do
- @ca_app = Puppet::Application[:ca]
+ @cert_app = Puppet::Application[:cert]
Puppet::Util::Log.stubs(:newdestination)
Puppet::Util::Log.stubs(:level=)
end
it "should ask Puppet::Application to parse Puppet configuration file" do
- @ca_app.should_parse_config?.should be_true
+ @cert_app.should_parse_config?.should be_true
end
it "should declare a main command" do
- @ca_app.should respond_to(:main)
+ @cert_app.should respond_to(:main)
end
Puppet::SSL::CertificateAuthority::Interface::INTERFACE_METHODS.reject{ |m| m == :destroy }.each do |method|
it "should declare option --#{method}" do
- @ca_app.should respond_to("handle_#{method}".to_sym)
+ @cert_app.should respond_to("handle_#{method}".to_sym)
end
end
@@ -29,37 +29,37 @@ describe "PuppetCA" do
Puppet::Log.expects(:level=).with(:info)
- @ca_app.handle_verbose(0)
+ @cert_app.handle_verbose(0)
end
it "should set log level to debug with the --debug option" do
Puppet::Log.expects(:level=).with(:debug)
- @ca_app.handle_debug(0)
+ @cert_app.handle_debug(0)
end
it "should set the fingerprint digest with the --digest option" do
- @ca_app.handle_digest(:digest)
+ @cert_app.handle_digest(:digest)
- @ca_app.digest.should == :digest
+ @cert_app.digest.should == :digest
end
it "should set mode to :destroy for --clean" do
- @ca_app.handle_clean(0)
- @ca_app.mode.should == :destroy
+ @cert_app.handle_clean(0)
+ @cert_app.mode.should == :destroy
end
it "should set all to true for --all" do
- @ca_app.handle_all(0)
- @ca_app.all.should be_true
+ @cert_app.handle_all(0)
+ @cert_app.all.should be_true
end
Puppet::SSL::CertificateAuthority::Interface::INTERFACE_METHODS.reject { |m| m == :destroy }.each do |method|
it "should set mode to #{method} with option --#{method}" do
- @ca_app.send("handle_#{method}".to_sym, nil)
+ @cert_app.send("handle_#{method}".to_sym, nil)
- @ca_app.mode.should == method
+ @cert_app.mode.should == method
end
end
@@ -74,57 +74,57 @@ describe "PuppetCA" do
it "should set console as the log destination" do
Puppet::Log.expects(:newdestination).with(:console)
- @ca_app.run_setup
+ @cert_app.run_setup
end
it "should print puppet config if asked to in Puppet config" do
- @ca_app.stubs(:exit)
+ @cert_app.stubs(:exit)
Puppet.settings.stubs(:print_configs?).returns(true)
Puppet.settings.expects(:print_configs)
- @ca_app.run_setup
+ @cert_app.run_setup
end
it "should exit after printing puppet config if asked to in Puppet config" do
Puppet.settings.stubs(:print_configs?).returns(true)
- lambda { @ca_app.run_setup }.should raise_error(SystemExit)
+ lambda { @cert_app.run_setup }.should raise_error(SystemExit)
end
it "should set the CA location to 'only'" do
Puppet::SSL::Host.expects(:ca_location=).with(:only)
- @ca_app.run_setup
+ @cert_app.run_setup
end
it "should create a new certificate authority" do
Puppet::SSL::CertificateAuthority.expects(:new)
- @ca_app.run_setup
+ @cert_app.run_setup
end
end
describe "when running" do
before :each do
- @ca_app.all = false
+ @cert_app.all = false
@ca = stub_everything 'ca'
- @ca_app.ca = @ca
+ @cert_app.ca = @ca
ARGV.stubs(:collect).returns([])
end
it "should delegate to the CertificateAuthority" do
@ca.expects(:apply)
- @ca_app.main
+ @cert_app.main
end
it "should delegate with :all if option --all was given" do
- @ca_app.handle_all(0)
+ @cert_app.handle_all(0)
@ca.expects(:apply).with { |mode,to| to[:to] == :all }
- @ca_app.main
+ @cert_app.main
end
it "should delegate to ca.apply with the hosts given on command line" do
@@ -132,35 +132,35 @@ describe "PuppetCA" do
@ca.expects(:apply).with { |mode,to| to[:to] == ["host"]}
- @ca_app.main
+ @cert_app.main
end
it "should send the currently set digest" do
ARGV.stubs(:collect).returns(["host"])
- @ca_app.handle_digest(:digest)
+ @cert_app.handle_digest(:digest)
@ca.expects(:apply).with { |mode,to| to[:digest] == :digest}
- @ca_app.main
+ @cert_app.main
end
it "should delegate to ca.apply with current set mode" do
- @ca_app.mode = "currentmode"
+ @cert_app.mode = "currentmode"
ARGV.stubs(:collect).returns(["host"])
@ca.expects(:apply).with { |mode,to| mode == "currentmode" }
- @ca_app.main
+ @cert_app.main
end
it "should revoke cert if mode is clean" do
- @ca_app.mode = :destroy
+ @cert_app.mode = :destroy
ARGV.stubs(:collect).returns(["host"])
@ca.expects(:apply).with { |mode,to| mode == :revoke }
@ca.expects(:apply).with { |mode,to| mode == :destroy }
- @ca_app.main
+ @cert_app.main
end
end
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list