tripleo-common/tools/check_duplicate_jinja_blocks.sh
Pablo Iranzo Gómez 79a1a4b275
Add bashate in gate jobs and fix existing errors
Change-Id: I3cbf754ea9c037df8b95eb6f83dbe8ce09bfd717
Signed-off-by: Pablo Iranzo Gómez <Pablo.Iranzo@gmail.com>
2018-09-17 11:36:57 +02:00

22 lines
388 B
Bash
Executable File

#!/bin/sh
myname=${0##*/}
path=container-images/tripleo_kolla_template_overrides.j2
grep '{% block' $path |
sort |
uniq -c |
awk -v myname=$myname '
$1 == 2 {
printf "%s: found duplicate block for %s\n", myname, $4
retval=1
}
END {exit retval}
'
if [ $? -ne 0 ]; then
echo "$myname: duplicate jinja block declarations found in $path" >&2
exit 1
fi