summaryrefslogtreecommitdiffstats
path: root/ext/module_puppet
diff options
context:
space:
mode:
Diffstat (limited to 'ext/module_puppet')
-rwxr-xr-xext/module_puppet21
1 files changed, 10 insertions, 11 deletions
diff --git a/ext/module_puppet b/ext/module_puppet
index 388b3a1c1..542b93207 100755
--- a/ext/module_puppet
+++ b/ext/module_puppet
@@ -83,9 +83,7 @@ master = {
:Local => true
}
-# We default to a non-console log destination, because we assume this is being
-# run non-interactively.
-#Puppet[:logdest] = :console
+setdest = false
begin
result.each { |opt,arg|
@@ -103,12 +101,17 @@ begin
when "--use-nodes"
master[:UseNodes] = true
when "--verbose"
+ Puppet::Log.level = :info
+ Puppet::Log.newdestination(:console)
verbose = true
when "--debug"
+ Puppet::Log.level = :debug
+ Puppet::Log.newdestination(:console)
debug = true
when "--logdest"
begin
Puppet::Log.newdestination arg
+ setdest=true
rescue => detail
$stderr.puts detail.to_s
end
@@ -124,14 +127,6 @@ rescue GetoptLong::InvalidOption => detail
exit(1)
end
-if debug
- Puppet::Log.level = :debug
- Puppet::Log.newdestination :console
-elsif verbose
- Puppet::Log.level = :info
- Puppet::Log.newdestination :console
-end
-
# Now parse the config
if Puppet[:config] and File.exists? Puppet[:config]
Puppet.config.parse(Puppet[:config])
@@ -145,6 +140,10 @@ unless ARGV.length > 0
exit(14)
end
+unless setdest
+ Puppet::Log.newdestination(:syslog)
+end
+
master[:File] = ARGV.shift
unless ENV.include?("CFALLCLASSES")