Skip to content

Commit

Permalink
properly scope try/except when loading obsoleted keys
Browse files Browse the repository at this point in the history
We want to load all possible keys, even *after* a KeyError happenend

Fixes: 7e0fb44
  • Loading branch information
evgeni committed Aug 21, 2024
1 parent 7e0fb44 commit 2a2f921
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ def _get_obsolete_keys():
distribution = api.current_actor().configuration.os_release.release_id
obsoleted_keys_map = get_distribution_data(distribution).get('obsoleted-keys', {})
keys = []
try:
for version in range(7, int(get_target_major_version()) + 1):
for version in range(7, int(get_target_major_version()) + 1):
try:
for key in obsoleted_keys_map[str(version)]:
name, version, release = key.rsplit("-", 2)
if has_package(InstalledRPM, name, version=version, release=release):
keys.append(key)
except KeyError:
pass
except KeyError:
pass

return keys

Expand Down

0 comments on commit 2a2f921

Please sign in to comment.