Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
oo-diagnostics: Fix comments for test_node_mco_log
Browse files Browse the repository at this point in the history
Place comments with relevant code, consistently use proper case and
punctuation, and use whitespace for better logical grouping.
  • Loading branch information
Miciah committed May 2, 2014
1 parent 76ec64d commit 6a917ca
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions common/bin/oo-diagnostics
Original file line number Diff line number Diff line change
Expand Up @@ -768,22 +768,22 @@ class OODiag

def test_node_mco_log
skip_test unless @is_node
#
# create a tmp file with all of the unique log statements after most recent mcollective start

logfile = "#{@scl_prefix}mcollective.log"
logfile = [ "/var/log/openshift/node/#{logfile}", "/var/log/#{logfile}" ].find {|f| File.exist? f}
if logfile.nil? || logfile.empty?
do_fail <<-"FAIL"
No node mcollective log file found.
FAIL
verbose 'No node mcollective log file found.'
skip_test
end

# Create a tmp file with all of the unique log statements after most recent mcollective start.
tmpfile = Tempfile.new("oodiag-mco-#{$$}").path
system %Q! sed -n 'H; /INFO.*The Marionette Collective.*started logging/h; ${g;p;}' #{logfile} | sed 's|^\w, \[[^]]*\]||' | sort -u > #{tmpfile} !
# if no restart seen, just use the whole thing

# If no restart seen, just use the whole thing.
system %Q! sort -u /var/log/#{@scl_prefix}mcollective.log > #{tmpfile} ! unless File.exists? tmpfile
return unless File.exists? tmpfile
#

# Look for the mco timeout warning
out = `grep 'WARN.*created at [0-9]* is [0-9]* seconds old, TTL is' #{tmpfile}`
unless out.empty?
Expand All @@ -802,8 +802,8 @@ class OODiag
TIMEOUT
do_fail errors
end
#
# clean up temp file

# Clean up temp file.
system "rm #{tmpfile}"
end

Expand Down

0 comments on commit 6a917ca

Please sign in to comment.