summaryrefslogtreecommitdiffstats
path: root/lib/puppet/application
diff options
context:
space:
mode:
authorNigel Kersten <nigelk@google.com>2010-06-03 10:30:11 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitb96cd6cc6e381b83abde6b3b3e5a6b6604f909c1 (patch)
tree3b33b1dec19e37628d69847f90a344825a3501a2 /lib/puppet/application
parent0a21e1b7510d32e391e6263814bad5cc70c5d6dd (diff)
downloadpuppet-b96cd6cc6e381b83abde6b3b3e5a6b6604f909c1.tar.gz
puppet-b96cd6cc6e381b83abde6b3b3e5a6b6604f909c1.tar.xz
puppet-b96cd6cc6e381b83abde6b3b3e5a6b6604f909c1.zip
Fixes #2646. Move onetime option from the agent to global defaults so we can specify
it in the config file.
Diffstat (limited to 'lib/puppet/application')
-rw-r--r--lib/puppet/application/agent.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb
index 39e6ff38c..5c404c345 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"