Check component repo before disabling delorean repo

The upgrade component jobs starts with the component
repo disabled. As such do not diabled the delorean repo
unless the component repo exists and is enabled.

Closes-Bug: #1931207
Change-Id: Ia32a46826aed6313f47021540287c52c4ca4e32e
This commit is contained in:
Ronelle Landy 2021-06-08 14:25:53 -04:00
parent d5504218ef
commit 141194c402
5 changed files with 5 additions and 5 deletions

View File

@ -189,7 +189,7 @@ repo_cmd_after: |
sudo rm -rf /etc/yum.repos.d/CentOS-OpenStack-*.repo /etc/yum.repos.d/CentOS-Ceph-*.repo;
# Disable delorean repo if a similar component repo exists
{% if job is defined and job.component is defined %}
if [ -f "/etc/yum.repos.d/{{ job.component }}-component.repo" ]; then
if [ -f "/etc/yum.repos.d/{{ job.component }}-component.repo" ] && sudo cat /etc/yum.repos.d/{{ job.component }}-component.repo | grep 'enabled=1'; then
dnf config-manager --disable delorean-component-{{ job.component }};
fi
{% endif %}

View File

@ -191,7 +191,7 @@ repo_cmd_after: |
sudo rm -rf /etc/yum.repos.d/CentOS-OpenStack-*.repo /etc/yum.repos.d/CentOS-Ceph-*.repo;
# Disable delorean repo if a similar component repo exists
{% if job is defined and job.component is defined %}
if [ -f "/etc/yum.repos.d/{{ job.component }}-component.repo" ]; then
if [ -f "/etc/yum.repos.d/{{ job.component }}-component.repo" ] && sudo cat /etc/yum.repos.d/{{ job.component }}-component.repo | grep 'enabled=1'; then
dnf config-manager --disable delorean-component-{{ job.component }};
fi
{% endif %}

View File

@ -200,7 +200,7 @@ repo_cmd_after: |
sudo rm -rf /etc/yum.repos.d/CentOS-OpenStack-*.repo /etc/yum.repos.d/CentOS-Ceph-*.repo;
# Disable delorean repo if a similar component repo exists
{% if job is defined and job.component is defined %}
if [ -f "/etc/yum.repos.d/{{ job.component }}-component.repo" ]; then
if [ -f "/etc/yum.repos.d/{{ job.component }}-component.repo" ] && sudo cat /etc/yum.repos.d/{{ job.component }}-component.repo | grep 'enabled=1'; then
dnf config-manager --disable delorean-component-{{ job.component }};
fi
{% endif %}

View File

@ -191,7 +191,7 @@ repo_cmd_after: |
sudo rm -rf /etc/yum.repos.d/CentOS-OpenStack-*.repo /etc/yum.repos.d/CentOS-Ceph-*.repo;
# Disable delorean repo if a similar component repo exists
{% if job is defined and job.component is defined %}
if [ -f "/etc/yum.repos.d/{{ job.component }}-component.repo" ]; then
if [ -f "/etc/yum.repos.d/{{ job.component }}-component.repo" ] && sudo cat /etc/yum.repos.d/{{ job.component }}-component.repo | grep 'enabled=1'; then
dnf config-manager --disable delorean-component-{{ job.component }};
fi
{% endif %}

View File

@ -188,7 +188,7 @@ repo_cmd_after: |
sudo rm -rf /etc/yum.repos.d/CentOS-OpenStack-*.repo /etc/yum.repos.d/CentOS-Ceph-*.repo;
# Disable delorean repo if a similar component repo exists
{% if job is defined and job.component is defined %}
if [ -f "/etc/yum.repos.d/{{ job.component }}-component.repo" ]; then
if [ -f "/etc/yum.repos.d/{{ job.component }}-component.repo" ] && sudo cat /etc/yum.repos.d/{{ job.component }}-component.repo | grep 'enabled=1'; then
dnf config-manager --disable delorean-component-{{ job.component }};
fi
{% endif %}