Skip to content

Commit 70d22e4

Browse files
authored
Merge pull request #775 from stackhpc/fix-child-container-builds
Check if repos backup exists in kolla footer
2 parents b28e122 + 7c2f630 commit 70d22e4

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

etc/kayobe/kolla.yml

Lines changed: 12 additions & 8 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; \
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+
rm -rf /etc/yum.repos.d.backup/; \
359358
fi && \
360-
rm -rf /etc/yum.repos.d.backup/
359+
if grep -r '{{ stackhpc_repo_mirror_url }}' /etc/yum.repos.d; then \
360+
echo "Found repository mirror in Yum repositories"; \
361+
exit 1; \
362+
fi
361363
{% else %}
362364
RUN \
363-
mv /etc/apt/sources.list.backup /etc/apt/sources.list && \
365+
if [ -f /etc/apt/sources.list.backup ]; then \
366+
mv /etc/apt/sources.list.backup /etc/apt/sources.list; \
367+
fi && \
364368
if grep -r '{{ stackhpc_repo_mirror_url }}' /etc/apt/sources.list; then \
365-
echo "Found repository mirror in APT repositories"; \
366-
exit 1; \
369+
echo "Found repository mirror in APT repositories"; \
370+
exit 1; \
367371
fi
368372
{% endif %}
369373
{% endif %}

0 commit comments

Comments
 (0)