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 test_node_mco_log when no log
Browse files Browse the repository at this point in the history
Make test_node_mco_log fail gracefully when the node mcollective log file
is absent.  Before this commit, the test would hang because it would run
a sed command with no input file provided.

This commit fixes bug 1077664.
  • Loading branch information
Miciah committed Mar 18, 2014
1 parent bfb66b6 commit 76ec64d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/bin/oo-diagnostics
Expand Up @@ -772,6 +772,12 @@ class OODiag
# 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
skip_test
end
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
Expand Down

0 comments on commit 76ec64d

Please sign in to comment.