Skip to content

Commit be9efd1

Browse files
committed
Check if repos backup exists in kolla footer
When a child service is build, such as neutron-infoblox-ipam-agent being a child of neutron-server, the fotoer is ran twice. This means it fails as the repo backup has already been moved.
1 parent 5c7e56b commit be9efd1

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

etc/kayobe/kolla.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -352,18 +352,22 @@ kolla_build_blocks:
352352
{% if stackhpc_kolla_clean_up_repo_mirrors | bool %}
353353
{% if kolla_base_distro in ['centos', 'rocky'] %}
354354
RUN \
355-
tar -xzf /etc/yum.repos.d.backup/repos.tar.gz -C /etc/yum.repos.d && \
356-
if grep -r '{{ stackhpc_repo_mirror_url }}' /etc/yum.repos.d; then \
357-
echo "Found repository mirror in Yum repositories"; \
358-
exit 1; \
359-
fi && \
360-
rm -rf /etc/yum.repos.d.backup/
355+
if [ -f /etc/yum.repos.d.backup/repos.tar.gz ]; then \
356+
tar -xzf /etc/yum.repos.d.backup/repos.tar.gz -C /etc/yum.repos.d && \
357+
if grep -r '{{ stackhpc_repo_mirror_url }}' /etc/yum.repos.d; then \
358+
echo "Found repository mirror in Yum repositories"; \
359+
exit 1; \
360+
fi && \
361+
rm -rf /etc/yum.repos.d.backup/
362+
fi
361363
{% else %}
362364
RUN \
363-
mv /etc/apt/sources.list.backup /etc/apt/sources.list && \
364-
if grep -r '{{ stackhpc_repo_mirror_url }}' /etc/apt/sources.list; then \
365-
echo "Found repository mirror in APT repositories"; \
366-
exit 1; \
365+
if [ -f /etc/apt/sources.list.backup ]; then \
366+
mv /etc/apt/sources.list.backup /etc/apt/sources.list && \
367+
if grep -r '{{ stackhpc_repo_mirror_url }}' /etc/apt/sources.list; then \
368+
echo "Found repository mirror in APT repositories"; \
369+
exit 1; \
370+
fi
367371
fi
368372
{% endif %}
369373
{% endif %}

0 commit comments

Comments
 (0)