attempt to fix tar extract and http reqs
This commit is contained in:
parent
28ba75d019
commit
82c7b60ef2
@ -637,18 +637,30 @@ class Shared:
|
|||||||
logger.error('There was an issue downloading from %s' % s3_bucket)
|
logger.error('There was an issue downloading from %s' % s3_bucket)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def reqs_determine_latest(s3_bucket_url, release, arches, filetype, name, logger):
|
def reqs_determine_latest(s3_bucket_url, release, arches, filetype, name, logger, page_size=1000):
|
||||||
"""
|
"""
|
||||||
Using requests, determine the latest artifacts and return a list
|
Using requests, determine the latest artifacts and return a list
|
||||||
"""
|
"""
|
||||||
temp = []
|
temp = []
|
||||||
data = {}
|
data = {}
|
||||||
|
marker = None
|
||||||
|
|
||||||
try:
|
while True:
|
||||||
bucket_data = requests.get(s3_bucket_url)
|
params = {}
|
||||||
except requests.exceptions.RequestException as e:
|
if marker is not None:
|
||||||
logger.error('The s3 bucket http endpoint is inaccessible')
|
params['marker'] = marker
|
||||||
raise SystemExit(e)
|
params['delimiter'] = '/'
|
||||||
|
params['max-keys'] = str(page_size)
|
||||||
|
|
||||||
|
try:
|
||||||
|
bucket_data = requests.get(
|
||||||
|
s3_bucket_url,
|
||||||
|
params=params,
|
||||||
|
timeout=100
|
||||||
|
)
|
||||||
|
except requests.exceptions.RequestException as e:
|
||||||
|
logger.error('The s3 bucket http endpoint is inaccessible')
|
||||||
|
raise SystemExit(e)
|
||||||
|
|
||||||
resp = xmltodict.parse(bucket_data.content)
|
resp = xmltodict.parse(bucket_data.content)
|
||||||
|
|
||||||
@ -1143,7 +1155,7 @@ class Shared:
|
|||||||
if not Shared.tar_is_within_directory(path, member_path):
|
if not Shared.tar_is_within_directory(path, member_path):
|
||||||
raise Exception("Path traversal attempted in tar file")
|
raise Exception("Path traversal attempted in tar file")
|
||||||
|
|
||||||
tar.extractall(path, members, numeric_owner)
|
tar.extractall(path=path, members=members, numeric_owner=numeric_owner)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def dnf_sync(repo, sync_root, work_root, arch, logger):
|
def dnf_sync(repo, sync_root, work_root, arch, logger):
|
||||||
|
Loading…
Reference in New Issue
Block a user