Skip to content

Commit

Permalink
feat(client): Support Fedora for egg update process
Browse files Browse the repository at this point in the history
* Card ID: CCT-1148

When developing or testing on Fedora, previous code would try to fetch
insights-client.el41.egg. Since Fedora 40-45 should match RHEL 10, this
code implements mapping between these two distributions.

For RHEL and CentOS, this patch contains no behavioral change.

Signed-off-by: mhorky <mhorky@redhat.com>
  • Loading branch information
m-horky committed Jan 29, 2025
1 parent feae6ba commit caf1f38
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions insights/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
get_tags,
write_tags,
migrate_tags,
os_release_info,
get_rhel_version,
get_parent_process)

NETWORK = constants.custom_network_log_level
Expand Down Expand Up @@ -131,11 +131,12 @@ def fetch(self, force=False):
self.tmpdir = tempfile.mkdtemp()
atexit.register(self.delete_tmpdir)
try:
_, os_release = os_release_info()
rhel_major = os_release.split('.')[0]
rhel_major = get_rhel_version()
# set egg name as 'insights-core.el#.egg' per RHEL #
egg_name = 'insights-core.el{0}.egg'.format(rhel_major)
except Exception:
logger.debug("Using versioned egg: {}".format(rhel_major))
except ValueError as exc:
logger.debug("Using non-versioned egg: {}".format(exc))
# set default egg as 'insights-core.egg'
egg_name = 'insights-core.egg'

Expand Down

0 comments on commit caf1f38

Please sign in to comment.