diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb
index 093e5b9..cd6523f 100644
--- a/lib/puppet/application/agent.rb
+++ b/lib/puppet/application/agent.rb
@@ -20,7 +20,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,
@@ -66,8 +65,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
@@ -98,7 +96,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
@@ -155,7 +153,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
@@ -276,7 +274,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 b0995c2..4df34e8 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -92,6 +92,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.",
--
1.7.0.4
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Developers" group.
> To post to this group, send email to puppe...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en
> .
>
--
Don't tell me how hard you work. Tell me how much you get done.
-- James Ling
---------------------------------------------------------------------
Luke Kanies -|- http://puppetlabs.com -|- +1(615)594-8199