Skip to content

Commit

Permalink
use translators
Browse files Browse the repository at this point in the history
  • Loading branch information
nazunalika committed May 5, 2024
1 parent 796e96e commit 17d8fd7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions iso/empanadas/empanadas/util/iso_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def __init__(
self.bugurl = rlvars['bugurl']

self.extra_files = rlvars['extra_files']
self.translators = config['translators']

self.container = config['container']
if 'container' in rlvars and len(rlvars['container']) > 0:
Expand Down Expand Up @@ -361,6 +362,7 @@ def run_pull_lorax_artifacts(self):
'tar.gz',
'lorax',
'buildiso',
self.translators,
self.log
)
else:
Expand Down Expand Up @@ -1361,6 +1363,7 @@ def run_pull_generic_images(self):
formattype,
variantname,
'buildimage',
self.translators,
self.log
)

Expand Down
10 changes: 7 additions & 3 deletions iso/empanadas/empanadas/util/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ def rsync_method(src, dest):
# pylint: disable=too-many-locals,too-many-arguments
@staticmethod
def s3_determine_latest(s3_bucket, release, arches, filetype, name,
root_prefix, logger):
root_prefix, translators, logger):
"""
Using native s3, determine the latest artifacts and return a dict
"""
Expand Down Expand Up @@ -641,9 +641,13 @@ def s3_determine_latest(s3_bucket, release, arches, filetype, name,

for arch in arches:
temps = []
start_of_path = f"{root_prefix}-{release.split('.')[0]}-{arch}"
new_arch = arch
# This is lazy, but...
if root_prefix == 'buildiso':
new_arch = translators[arch]
start_of_path = f"{root_prefix}-{release.split('.')[0]}-{new_arch}"
for y in temp:
if arch in y and start_of_path in y:
if arch in y and y.startswith(start_of_path):
temps.append(y)
temps.sort(reverse=True)
if len(temps) > 0:
Expand Down

0 comments on commit 17d8fd7

Please sign in to comment.