Skip to content

Commit

Permalink
Add workaround for CentOS 8 to fetch archived contents from new vault…
Browse files Browse the repository at this point in the history
… mirror

Signed-off-by: Gaurav Talreja <[email protected]>
  • Loading branch information
Gauravtalreja1 committed Oct 26, 2023
1 parent 7f22271 commit 98a3629
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/foreman/api/test_convert2rhel.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,15 @@ def centos(
# updating centos packages on CentOS 8 is necessary for conversion
major = version.split('.')[0]
if major == '8':
centos_host.execute('yum -y update centos-*')
release = centos_host.execute('cat /etc/redhat-release').stdout.splitlines()[0].split()[-1]
# Workaround: contents for CentOS 8 are archived and moved to vault mirror after it is EOL
centos_host.execute(
'sudo sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*'
)
centos_host.execute(
'sudo sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*'
)
centos_host.execute(f'yum -y --releasever={release} update centos-*')
repo_url = settings.repos.convert2rhel.convert_to_rhel_repo.format(major)
repo = create_repo(module_target_sat, module_entitlement_manifest_org, repo_url)
cv = update_cv(
Expand Down

0 comments on commit 98a3629

Please sign in to comment.