[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:34:51 UTC 2010


The following commit has been merged in the upstream branch:
commit b96cd6cc6e381b83abde6b3b3e5a6b6604f909c1
Author: Nigel Kersten <nigelk at google.com>
Date:   Thu Jun 3 10:30:11 2010 -0700

    Fixes #2646. Move onetime option from the agent to global defaults so we can specify
    it in the config file.

diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb
index 39e6ff3..5c404c3 100644
--- a/lib/puppet/application/agent.rb
+++ b/lib/puppet/application/agent.rb
@@ -16,7 +16,6 @@ class Puppet::Application::Agent < Puppet::Application
 
         {
             :waitforcert => 120,  # Default to checking for certs every 5 minutes
-            :onetime => false,
             :detailed_exitcodes => false,
             :verbose => false,
             :debug => false,
@@ -63,8 +62,7 @@ class Puppet::Application::Agent < Puppet::Application
         options[:client] = false
     end
 
-    option("--onetime", "-o") do |arg|
-        options[:onetime] = true
+    if Puppet[:onetime]
         options[:waitforcert] = 0 unless @explicit_waitforcert
     end
 
@@ -95,7 +93,7 @@ class Puppet::Application::Agent < Puppet::Application
 
     def run_command
         return fingerprint if options[:fingerprint]
-        return onetime if options[:onetime]
+        return onetime if Puppet[:onetime]
         return main
     end
 
@@ -152,7 +150,7 @@ class Puppet::Application::Agent < Puppet::Application
         Puppet.settings.handlearg("--show_diff")
         Puppet.settings.handlearg("--no-daemonize")
         options[:verbose] = true
-        options[:onetime] = true
+        Puppet[:onetime] = true
         options[:detailed_exitcodes] = true
         options[:waitforcert] = 0 unless @explicit_waitforcert
     end
@@ -277,7 +275,7 @@ class Puppet::Application::Agent < Puppet::Application
 
         # This has to go after the certs are dealt with.
         if Puppet[:listen]
-            unless options[:onetime]
+            unless Puppet[:onetime]
                 setup_listen
             else
                 Puppet.notice "Ignoring --listen on onetime run"
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index f2e498d..bba2bf2 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -55,6 +55,10 @@ module Puppet
             "Whether Puppet should manage the owner, group, and mode of files 
             it uses internally"
             ],
+        :onetime => [false,
+            "Run the configuration once, rather than as a long-running
+             daemon. This is useful for interactively running puppetd."
+            ],
         :path => {:default => "none",
             :desc => "The shell search path.  Defaults to whatever is inherited
                 from the parent process.",

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list