try to fix s3 pagination
This commit is contained in:
parent
d6cc56c7c0
commit
cab05e961f
@ -365,6 +365,10 @@ class IsoBuild:
|
||||
arch
|
||||
)
|
||||
|
||||
if arch not in latest_artifacts:
|
||||
self.log.error(Color.FAIL + 'No lorax artifacts for ' + arch)
|
||||
continue
|
||||
|
||||
source_path = latest_artifacts[arch]
|
||||
|
||||
full_drop = '{}/lorax-{}-{}.tar.gz'.format(
|
||||
|
@ -566,7 +566,7 @@ class Shared:
|
||||
s3 = boto3.client('s3')
|
||||
|
||||
try:
|
||||
s3.list_objects(Bucket=s3_bucket)['Contents']
|
||||
res = s3.list_objects(Bucket=s3_bucket)['Contents']
|
||||
except:
|
||||
logger.error(
|
||||
'[' + Color.BOLD + Color.RED + 'FAIL' + Color.END + '] ' +
|
||||
@ -574,9 +574,19 @@ class Shared:
|
||||
)
|
||||
raise SystemExit()
|
||||
|
||||
for y in s3.list_objects(Bucket=s3_bucket)['Contents']:
|
||||
if filetype in y['Key'] and release in y['Key'] and name in y['Key']:
|
||||
objs = res['Contents']
|
||||
|
||||
while True:
|
||||
for y in objs:
|
||||
key = y['Key']
|
||||
if filetype in key and release in key and name in key:
|
||||
temp.append(y['Key'])
|
||||
next_token = res.get("NextContinuationToken", None)
|
||||
if next_token:
|
||||
res = s3.list_objects_v2(Bucket=s3_bucket, ContinuationToken=next_token)
|
||||
objs = res['Contents']
|
||||
else:
|
||||
break
|
||||
|
||||
for arch in arches:
|
||||
temps = []
|
||||
|
Loading…
Reference in New Issue
Block a user