From 17d8fd7f23c097f23de74baa3692cc9e1c10db0e Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Sat, 4 May 2024 18:30:35 -0700 Subject: [PATCH] use translators --- iso/empanadas/empanadas/util/iso_utils.py | 3 +++ iso/empanadas/empanadas/util/shared.py | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/iso/empanadas/empanadas/util/iso_utils.py b/iso/empanadas/empanadas/util/iso_utils.py index 8be971d..95a2860 100644 --- a/iso/empanadas/empanadas/util/iso_utils.py +++ b/iso/empanadas/empanadas/util/iso_utils.py @@ -118,6 +118,7 @@ class IsoBuild: 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: @@ -361,6 +362,7 @@ class IsoBuild: 'tar.gz', 'lorax', 'buildiso', + self.translators, self.log ) else: @@ -1361,6 +1363,7 @@ class IsoBuild: formattype, variantname, 'buildimage', + self.translators, self.log ) diff --git a/iso/empanadas/empanadas/util/shared.py b/iso/empanadas/empanadas/util/shared.py index f142892..df599b7 100644 --- a/iso/empanadas/empanadas/util/shared.py +++ b/iso/empanadas/empanadas/util/shared.py @@ -608,7 +608,7 @@ class Shared: # 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 """ @@ -641,9 +641,13 @@ class Shared: 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: