aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin André <m.andre@redhat.com>2018-05-07 15:55:59 +0200
committerMartin André <m.andre@redhat.com>2018-05-08 09:08:05 +0200
commit58742c212e0bdc5092ba6cc0da2fc8c5589bb172 (patch)
tree89490849b6f3f1398a2034777890785b175e48d2
parent59ec7c7cf240da409c293e30ce7f0599542ad7a7 (diff)
downloadkolla-58742c212e0bdc5092ba6cc0da2fc8c5589bb172.tar.gz
kolla-58742c212e0bdc5092ba6cc0da2fc8c5589bb172.zip
Create symlinks for failed builds logs
This allows to know which image failed to build without having to parse the huge job-output.txt file. This commit creates a convenient 000_FAILED_image_name.log symlink to the relevant log files when kolla is configured to output to a log directory. This creates symlinks only for the parent image with error, i.e. it skips images that failed to build because of parent error. Change-Id: I05954e2335dc3fac469276809c91f9c87e3ecab2
-rwxr-xr-xkolla/image/build.py4
-rw-r--r--tests/playbooks/post.yml6
2 files changed, 10 insertions, 0 deletions
diff --git a/kolla/image/build.py b/kolla/image/build.py
index cd59aa260..8f617c69e 100755
--- a/kolla/image/build.py
+++ b/kolla/image/build.py
@@ -1018,6 +1018,10 @@ class KollaWorker(object):
'name': name,
'status': status,
})
+ if self.conf.logs_dir and status == STATUS_ERROR:
+ os.symlink("%s.log" % name,
+ os.path.join(self.conf.logs_dir,
+ "000_FAILED_%s.log" % name))
if self.image_statuses_unmatched:
LOG.debug("=====================================")
diff --git a/tests/playbooks/post.yml b/tests/playbooks/post.yml
index 413d3f757..9ed6128c5 100644
--- a/tests/playbooks/post.yml
+++ b/tests/playbooks/post.yml
@@ -65,6 +65,12 @@
sudo mv $f ${f/.log/.txt}
done
+ # Update symlinks to new file names
+ for f in $(find logs -name "*FAILED*"); do
+ sudo mv ${f} ${f}.gz
+ sudo ln -sf ${f#*/000_FAILED_}.gz ${f}.gz
+ done
+
# append .txt to all kolla config file
find logs/kolla_configs -type f -exec mv '{}' '{}'.txt \;