[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35
Markus Roberts
Markus at reality.com
Wed Jul 14 10:35:11 UTC 2010
The following commit has been merged in the upstream branch:
commit c8089f1213302bea3f11250177afa6e96b566e12
Author: Nick Lewis <nick at puppetlabs.com>
Date: Thu Jun 24 15:22:16 2010 -0700
[#2646] Fixes the change to onetime made in b96cd6c
This change allows the --onetime command line option to be set by the
Puppet[:onetime] global option or read from the config file, rather than
forcing it to be read from the config file.
diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb
index 5c404c3..c82491d 100644
--- a/lib/puppet/application/agent.rb
+++ b/lib/puppet/application/agent.rb
@@ -1,3 +1,4 @@
+require 'puppet'
require 'puppet/application'
class Puppet::Application::Agent < Puppet::Application
@@ -62,7 +63,8 @@ class Puppet::Application::Agent < Puppet::Application
options[:client] = false
end
- if Puppet[:onetime]
+ option("--onetime", "-o") do |arg|
+ Puppet[:onetime] = true
options[:waitforcert] = 0 unless @explicit_waitforcert
end
diff --git a/spec/unit/application/agent_spec.rb b/spec/unit/application/agent_spec.rb
index 8733b6a..76a378e 100755
--- a/spec/unit/application/agent_spec.rb
+++ b/spec/unit/application/agent_spec.rb
@@ -2,6 +2,7 @@
require File.dirname(__FILE__) + '/../../spec_helper'
+require 'puppet/agent'
require 'puppet/application/agent'
require 'puppet/network/server'
require 'puppet/daemon'
@@ -119,9 +120,9 @@ describe Puppet::Application::Agent do
@puppetd.options[:client].should be_false
end
- it "should set onetime to ture with --onetime" do
+ it "should set onetime to true with --onetime" do
@puppetd.handle_onetime(nil)
- @puppetd.options[:onetime].should be_true
+ Puppet[:onetime].should be_true
end
it "should set waitforcert to 0 with --onetime and if --waitforcert wasn't given" do
@@ -214,7 +215,7 @@ describe Puppet::Application::Agent do
@puppetd.setup_test
end
it "should set options[:onetime] to true" do
- @puppetd.options.expects(:[]=).with(:onetime,true)
+ Puppet.expects(:[]=).with(:onetime,true)
@puppetd.setup_test
end
it "should set options[:detailed_exitcodes] to true" do
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list