Guard against os-log-merger failure

At the moment, the tool may crash parsing some files, which renders the
whole run failed. Until we fix that in the next os-log-merger, just
ignore failures and proceed. Of course, that will mean no -index.txt
file generated, or with incomplete data. Still better than just
invalidating the test run.

Change-Id: I28300de31ed49b1a21e4c1ed1f7d10f90943878b
This commit is contained in:
Ihar Hrachyshka 2017-03-08 06:07:21 +00:00
parent 6ed307eb98
commit a457949bf7
1 changed files with 3 additions and 1 deletions

View File

@ -29,7 +29,9 @@ function generate_log_index {
/tmp/os-log-merger/bin/pip install -U os-log-merger==1.0.6
files=$(find /opt/stack/logs/$venv-logs -name '*.txt' -o -name '*.log')
# -a3 to truncate common path prefix
contents=$(/tmp/os-log-merger/bin/os-log-merger -a3 $files)
# || true to avoid the whole run failure because of os-log-merger crashes and such
# TODO(ihrachys) remove || true when we have more trust in os-log-merger
contents=$(/tmp/os-log-merger/bin/os-log-merger -a3 $files || true)
# don't store DEBUG level messages because they are not very useful,
# and are not indexed by logstash anyway
echo "$contents" | grep -v DEBUG | sudo tee /opt/stack/logs/$venv-index.txt > /dev/null