From a457949bf7aafacf4107a8efc491ce8d45e6a322 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Wed, 8 Mar 2017 06:07:21 +0000 Subject: [PATCH] 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 --- neutron/tests/contrib/post_test_hook.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neutron/tests/contrib/post_test_hook.sh b/neutron/tests/contrib/post_test_hook.sh index 81e6e72534a..279dd1ac5f5 100644 --- a/neutron/tests/contrib/post_test_hook.sh +++ b/neutron/tests/contrib/post_test_hook.sh @@ -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