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
(cherry picked from commit 58742c212e)
This commit is contained in:
Martin André 2018-05-07 15:55:59 +02:00
parent 37c1731da1
commit ccc3ecf3d7
2 changed files with 10 additions and 0 deletions

View File

@ -1019,6 +1019,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("=====================================")

View File

@ -64,6 +64,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 \;