diff options
author | James Turnbull <james@lovedthanlost.net> | 2008-03-18 13:52:18 +1100 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-03-20 11:31:13 -0500 |
commit | 2155fe156ed8a3866d9a03b9e836e23a24ce9259 (patch) | |
tree | 05ed9505d7fec3587d4441d4ca68dbd2bccc16b7 | |
parent | 4cc18ed43637efa9064a302b76d8565c0f706ebe (diff) | |
download | puppet-2155fe156ed8a3866d9a03b9e836e23a24ce9259.tar.gz puppet-2155fe156ed8a3866d9a03b9e836e23a24ce9259.tar.xz puppet-2155fe156ed8a3866d9a03b9e836e23a24ce9259.zip |
Fix for ticket #1136 --verbose cancels out --debug
-rwxr-xr-x | bin/puppetd | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/bin/puppetd b/bin/puppetd index e993d3aa8..81afd69e8 100755 --- a/bin/puppetd +++ b/bin/puppetd @@ -188,6 +188,8 @@ args = {} options = { :waitforcert => 120, # Default to checking for certs every 5 minutes :onetime => false, + :verbose => false, + :debug => false, :centrallogs => false, :setdest => false, :enable => false, @@ -228,11 +230,9 @@ begin puts "%s" % Puppet.version exit when "--verbose" - Puppet::Util::Log.level = :info - Puppet::Util::Log.newdestination(:console) + options[:verbose] = true when "--debug" - Puppet::Util::Log.level = :debug - Puppet::Util::Log.newdestination(:console) + options[:debug] = true when "--fqdn" options[:fqdn] = arg when "--no-client" @@ -247,6 +247,9 @@ begin Puppet::Util::Log.newdestination(arg) options[:setdest] = true rescue => detail + if Puppet[:debug] + puts detail.backtrace + end $stderr.puts detail.to_s end when "--waitforcert" @@ -265,6 +268,20 @@ end # Now parse the config Puppet.parse_config +# Handle the logging settings. +if options[:debug] or options[:verbose] + Puppet::Util::Log.newdestination(:console) + if options[:debug] + Puppet::Util::Log.level = :debug + else + Puppet::Util::Log.level = :info + end +end + +unless options[:setdest] + Puppet::Util::Log.newdestination(:syslog) +end + if options[:test] # Enable all of the most common test options. Puppet.settings.handlearg("--ignorecache") @@ -272,12 +289,9 @@ if options[:test] Puppet.settings.handlearg("--no-splay") Puppet.settings.handlearg("--show_diff") Puppet.settings.handlearg("--no-daemonize") + Puppet.settings.handlearg("--verbose") options[:onetime] = true options[:waitforcert] = 0 - unless Puppet::Util::Log.level == :debug - Puppet::Util::Log.level = :info - end - Puppet::Util::Log.newdestination(:console) end Puppet.genconfig @@ -288,10 +302,6 @@ if Puppet[:noop] Puppet[:show_diff] = true end -unless options[:setdest] - Puppet::Util::Log.newdestination(:syslog) -end - args[:Server] = Puppet[:server] if options[:fqdn] args[:FQDN] = options[:fqdn] |