Skip to content

Commit

Permalink
don't fail when DNF can't reach repos during sub-man prereqs
Browse files Browse the repository at this point in the history
When a host has repositories configured it can't reach, DNF will error
out when we call `dnf_base.fill_sack()` and abort the execution of the
script.
However, we only need repo data to learn whether sub-man is available,
but given in most cases it's installed already, we don't need this
information and can live with it not being upgradeable (the code later
on handles that case gracefully).
  • Loading branch information
evgeni committed Dec 12, 2024
1 parent 9df0b4a commit aeced91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ def install_prereqs():
dnf_base.conf.read()
dnf_base.conf.substitutions.update_from_etc('/')
dnf_base.read_all_repos()
dnf_base.fill_sack()
try:
dnf_base.fill_sack()
except: # noqa: E722, pylint:disable=bare-except
pass
pkg_list = dnf_base.sack.query().filter(name='subscription-manager')
subman_installed = pkg_list.installed().run()
subman_available = pkg_list.available().run()
Expand Down

0 comments on commit aeced91

Please sign in to comment.