Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: download egg as per the RHEL major version #4266

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions insights/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
get_tags,
write_tags,
migrate_tags,
os_release_info,
get_parent_process)

NETWORK = constants.custom_network_log_level
Expand Down Expand Up @@ -121,9 +122,18 @@ 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]
# set egg name as 'insights-core.el#.egg' per RHEL #
egg_name = 'insights-core.el{0}.egg'.format(rhel_major)
except Exception:
# set default egg as 'insights-core.egg'
egg_name = 'insights-core.egg'

fetch_results = {
'core': os.path.join(self.tmpdir, 'insights-core.egg'),
'gpg_sig': os.path.join(self.tmpdir, 'insights-core.egg.asc')
'core': os.path.join(self.tmpdir, egg_name),
'gpg_sig': os.path.join(self.tmpdir, '{0}.asc'.format(egg_name))
}

logger.debug("Beginning core fetch.")
Expand All @@ -141,13 +151,13 @@ def fetch(self, force=False):
egg_url = self.config.egg_path
egg_gpg_url = self.config.egg_gpg_path
if egg_url is None:
egg_url = '/v1/static{0}/insights-core.egg'.format(egg_release)
egg_url = '/v1/static{0}/{1}'.format(egg_release, egg_name)
# if self.config.legacy_upload:
# egg_url = '/v1/static/core/insights-core.egg'
# else:
# egg_url = '/static/insights-core.egg'
if egg_gpg_url is None:
egg_gpg_url = '/v1/static{0}/insights-core.egg.asc'.format(egg_release)
egg_gpg_url = '/v1/static{0}/{1}.asc'.format(egg_release, egg_name)
# if self.config.legacy_upload:
# egg_gpg_url = '/v1/static/core/insights-core.egg.asc'
# else:
Expand Down
Loading