ppc64le: Ensure that rabbitmq-server.repo exists before trying sed

TripleO container builds are currently failing for ppc64le as the
rabbitmq repo file doesn't exist, causing sed to fail. [0] The file not
existing is expected for TripleO image builds as these repos are
overriden in this case. [1] This patch tests that the file exists
to prevent this failure.

[0] https://centos.logs.rdoproject.org/tripleo-upstream-containers-build-master-ppc64le/1540/logs/logs/build.log
[1] http://eavesdrop.openstack.org/irclogs/%23openstack-kolla/%23openstack-kolla.2019-09-23.log.html#t2019-09-23T16:42:29

Change-Id: I7bf6d064ad8deb94a8fe53f4f4735f7b13ff27b1
Co-Authored-By: Mark Goddard <mark@stackhpc.com>
This commit is contained in:
Mike Turek 2019-09-23 16:48:50 +00:00
parent e3b2bb7808
commit 555765a7af
1 changed files with 5 additions and 1 deletions

View File

@ -112,8 +112,12 @@ COPY {{ repo_file }} /etc/yum.repos.d/{{ repo_file }}
# NOTE(hrw): 'rabbitmq-server' is 'noarch' so we can install it on ppc64le from
# repo for other architecture.
# NOTE(mjturek): tripleo-ci overrides these repos so the file would not exist
# in that case. We test for the file's existence to avoid sed failing in that case.
{% if base_arch == 'ppc64le' %}
RUN sed -i -e 's/\$basearch/x86_64/g' /etc/yum.repos.d/rabbitmq_rabbitmq-server.repo
RUN if [[ -e /etc/yum.repos.d/rabbitmq_rabbitmq-server.repo ]]; then \
sed -i -e 's/\$basearch/x86_64/g' /etc/yum.repos.d/rabbitmq_rabbitmq-server.repo; \
fi
{% endif %}
{% block base_centos_repo_overrides_post_copy %}{% endblock %}