validate-indentation: expand check to also catch macros.install_packages

Fixed up 5 Dockerfile.j2 files that had the issue

Change-Id: I8a5551050a75d64712c36d53573437a18777a82f
This commit is contained in:
Jon Schlueter 2018-07-26 14:50:39 -04:00
parent 778f6dc823
commit 2b023ba13e
6 changed files with 12 additions and 6 deletions

View File

@ -8,7 +8,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set mistral_event_engine_packages = ['openstack-mistral-event-engine'] %}
{{ macros.install_packages(mistral_event_engine_packages | customizable("packages")) }}
{{ macros.install_packages(mistral_event_engine_packages | customizable("packages")) }}
{% elif base_distro in ['debian', 'ubuntu'] %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false

View File

@ -21,7 +21,7 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
{% endif %}
{{ macros.install_packages(ironic_neutron_agent_packages | customizable("packages")) }}
{{ macros.install_packages(ironic_neutron_agent_packages | customizable("packages")) }}
{% endif %}

View File

@ -17,7 +17,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
] %}
{% endif %}
{{ macros.install_packages(neutron_metadata_agent_ovn_packages | customizable("packages")) }}
{{ macros.install_packages(neutron_metadata_agent_ovn_packages | customizable("packages")) }}
{% elif install_type == 'source' %}

View File

@ -25,7 +25,7 @@ RUN curl -ssL -o /opt/cadvisor https://github.com/google/cadvisor/releases/downl
'http://snapshot.debian.org/archive/debian/20180503T060640Z/pool/main/c/cadvisor/cadvisor_0.27.1+dfsg2-1_arm64.deb'
] %}
{{ macros.install_packages(cadvisor_packages | customizable("packages")) }}
{{ macros.install_packages(cadvisor_packages | customizable("packages")) }}
RUN ln -s /usr/bin/cadvisor /opt/cadvisor
{% endif %}

View File

@ -15,7 +15,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
] %}
{{ macros.install_packages(tripleo_ui_packages | customizable("packages")) }}
{{ macros.install_packages(tripleo_ui_packages | customizable("packages")) }}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
&& sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf
@ -34,7 +34,7 @@ RUN echo 'tripleo-ui not yet available for {{ base_distro }}' && /bin/false
] %}
{{ macros.install_packages(tripleo_ui_packages | customizable("packages")) }}
{{ macros.install_packages(tripleo_ui_packages | customizable("packages")) }}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
&& sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf

View File

@ -8,6 +8,12 @@ for dockerfile in "$@"; do
grep -E '^\s+[[:upper:]]+\s+' "$dockerfile"
RES=1
fi
if grep -qE '^\s+\{\{ macros\.install_packages' "$dockerfile"; then
echo "ERROR: $dockerfile has indented Dockerfile instruction" >&2
grep -E '^\s+\{\{ macros\.install_packages' "$dockerfile"
RES=1
fi
done
exit $RES