Disable delorean repo if a similar componet repo exists

The previous patch disabled the delorean repo
if the job had a component var defined.
This broke validation jobs.

The current patch checks for the existance
of the component repo file before disabling the
delorean repo.

Closes-Bug: #1929695
Change-Id: I88419d24735afd5840225c0d484bc6981738afb7
This commit is contained in:
Ronelle Landy 2021-05-26 08:41:12 -04:00
parent b532dbec12
commit ec6553e75c
1 changed files with 3 additions and 1 deletions

View File

@ -189,7 +189,9 @@ 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.component is defined %}
dnf config-manager --disable delorean-component-{{ job.component }};
if [ -f "/etc/yum.repos.d/{{ job.component }}-component.repo" ]; then
dnf config-manager --disable delorean-component-{{ job.component }};
fi
{% endif %}
sudo rm -rf /etc/yum.repos.d/*.rpmsave;
sudo dnf repolist;