File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff 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 %}
You can’t perform that action at this time.
0 commit comments