aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2022-03-04 10:01:29 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2022-03-04 15:03:55 +0100
commit5881b25584f793e3ad3576dcdf462d93ef169f81 (patch)
tree890d00d8c3a075b764105763f151956c09ba73f7
parent43ed792ae54af5d3179e16eb29e9b9821e7e1dee (diff)
Protect vs Bucket containing html charsstable/kali
It allows dumping MTS output files. Change-Id: I2b35ee81a764573a9d17cb3a225cb5febed5fa46 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r--xtesting/core/campaign.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/xtesting/core/campaign.py b/xtesting/core/campaign.py
index 4dca3041..aadba782 100644
--- a/xtesting/core/campaign.py
+++ b/xtesting/core/campaign.py
@@ -128,18 +128,21 @@ class Campaign():
# pylint: disable=no-member
for s3_object in b3resource.Bucket(bucket_name).objects.filter(
Prefix="{}/".format(prefix)):
- path, _ = os.path.split(s3_object.key)
+ path, _ = os.path.split(
+ urllib.parse.unquote_plus(s3_object.key))
lpath = re.sub('^{}/*'.format(s3path), '', path)
if lpath and not os.path.exists(lpath):
os.makedirs(lpath)
+ Campaign.__logger.info(
+ "Downloading %s",
+ re.sub('^{}/*'.format(s3path), '',
+ urllib.parse.unquote_plus(s3_object.key)))
# pylint: disable=no-member
b3resource.Bucket(bucket_name).download_file(
- s3_object.key,
- re.sub('^{}/*'.format(s3path), '', s3_object.key),
+ urllib.parse.unquote_plus(s3_object.key),
+ re.sub('^{}/*'.format(s3path), '',
+ urllib.parse.unquote_plus(s3_object.key)),
Config=tconfig)
- Campaign.__logger.info(
- "Downloading %s",
- re.sub('^{}/*'.format(s3path), '', s3_object.key))
return Campaign.EX_OK
except Exception: # pylint: disable=broad-except
Campaign.__logger.exception("Cannot publish the artifacts")