Greetings!
Please review the pull request #18: Fix stdout logging opened by (djm68)
Some more information about the pull request:
- Opened: Thu Sep 15 21:04:28 UTC 2011
- Based on: puppetlabs:master (35ad88d972e730145b7ea4b6f2a464eb29df1060)
- Requested merge: djm68:fix_stdout_logging (a99f4d08e489476c1104c6e9c8ff1602d43e68f6)
Description:
Added additional output to logging function to ease trouble shooting failures.
Thanks!
The Pull Request Bot
Diff follows:
diff --git a/lib/Result.rb b/lib/Result.rb
index 7ea9015..0240f7b 100644
--- a/lib/Result.rb
+++ b/lib/Result.rb
@@ -10,8 +10,8 @@ class Result
def log
Log.debug
- Log.debug "<STDOUT>\n#{stdout}\n</STDOUT>"
- Log.debug "<STDERR>\n#{stderr}\n</STDERR>"
- Log.debug "Exited with #{exit_code}"
+ Log.debug "<STDOUT>\n#{host}: #{stdout}\n</STDOUT>"
+ Log.debug "<STDERR>\n#{host}: #{stderr}\n</STDERR>"
+ Log.debug "#{host}: Exited with #{exit_code}"
end
end
diff --git a/lib/options_parsing.rb b/lib/options_parsing.rb
index 30b305d..ea0fed8 100644
--- a/lib/options_parsing.rb
+++ b/lib/options_parsing.rb
@@ -111,25 +111,20 @@ class Options
@options[:noinstall] = TRUE
end
- @options[:mrpropper] = FALSE
- opts.on( '--mrpropper', 'Clean hosts' ) do
- @options[:mrpropper] = TRUE
- end
-
@options[:notimesync] = FALSE
opts.on( '--no-ntp', 'skip ntpdate step' ) do
@options[:notimesync] = TRUE
end
- @options[:stdout_only] = false
+ @options[:stdout_only] = FALSE
opts.on('-s', '--stdout-only', 'log output to STDOUT but no files') do
- @options[:stdout_only] = true
+ @options[:stdout_only] = TRUE
end
- Log.stdout = true
+ Log.stdout = TRUE
opts.on('-q', '--quiet', 'don\'t log output to STDOUT') do
- Log.stdout = false
- @options[:quiet] = true
+ Log.stdout = FALSE
+ @options[:quiet] = FALSE
end
Log.color = true
diff --git a/lib/test_case.rb b/lib/test_case.rb
index f45e3dc..71c55b9 100644
--- a/lib/test_case.rb
+++ b/lib/test_case.rb
@@ -98,7 +98,7 @@ class TestCase
else
@result = command.exec(host, options)
- unless options[:silent] then
+ unless options[:stdout_only] then
result.log
if options[:acceptable_exit_codes].include?(exit_code)
# cool.
@@ -286,19 +286,6 @@ class TestCase
end
end
-
- def prep_initpp(host, entry, path="/etc/puppetlabs/puppet/modules/puppet_system_test/manifests")
- # Rewrite the init.pp file with an additional class to test
- # eg: class puppet_system_test {
- # include group
- # include user
- #}
- step "Append new system_test_class to init.pp"
- # on host,"cd #{path} && head -n -1 init.pp > tmp_init.pp && echo include #{entry} >> tmp_init.pp && echo \} >> tmp_init.pp && mv -f tmp_init.pp init.pp"
- on host,"cd #{path} && echo class puppet_system_test \{ > init.pp && echo include #{entry} >> init.pp && echo \} >>init.pp"
- end
-
-
def with_standard_output_to_logs
stdout = ''
old_stdout = $stdout
-- You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
