forked from sig_core/toolkit
try to fix s3 pagination
This commit is contained in:
parent
d6cc56c7c0
commit
cab05e961f
@ -365,6 +365,10 @@ class IsoBuild:
|
|||||||
arch
|
arch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if arch not in latest_artifacts:
|
||||||
|
self.log.error(Color.FAIL + 'No lorax artifacts for ' + arch)
|
||||||
|
continue
|
||||||
|
|
||||||
source_path = latest_artifacts[arch]
|
source_path = latest_artifacts[arch]
|
||||||
|
|
||||||
full_drop = '{}/lorax-{}-{}.tar.gz'.format(
|
full_drop = '{}/lorax-{}-{}.tar.gz'.format(
|
||||||
|
@ -566,7 +566,7 @@ class Shared:
|
|||||||
s3 = boto3.client('s3')
|
s3 = boto3.client('s3')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
s3.list_objects(Bucket=s3_bucket)['Contents']
|
res = s3.list_objects(Bucket=s3_bucket)['Contents']
|
||||||
except:
|
except:
|
||||||
logger.error(
|
logger.error(
|
||||||
'[' + Color.BOLD + Color.RED + 'FAIL' + Color.END + '] ' +
|
'[' + Color.BOLD + Color.RED + 'FAIL' + Color.END + '] ' +
|
||||||
@ -574,9 +574,19 @@ class Shared:
|
|||||||
)
|
)
|
||||||
raise SystemExit()
|
raise SystemExit()
|
||||||
|
|
||||||
for y in s3.list_objects(Bucket=s3_bucket)['Contents']:
|
objs = res['Contents']
|
||||||
if filetype in y['Key'] and release in y['Key'] and name in y['Key']:
|
|
||||||
|
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'])
|
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:
|
for arch in arches:
|
||||||
temps = []
|
temps = []
|
||||||
|
Loading…
Reference in New Issue
Block a user