aboutsummaryrefslogtreecommitdiffstats
path: root/functest_kubernetes/rally
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2021-09-11 10:24:53 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2021-09-11 10:54:47 +0200
commit6ff14fe8826bcb0f635319a51032900c862a9728 (patch)
treed152c672a91caf9bce730fb5f105388a1f6db0ae /functest_kubernetes/rally
parente2f255aaaddeb0b7bebd7a158b535aa0ecdf55e0 (diff)
Set encoding utf-8 when opening file
Change-Id: I4e756552173247499ba882bfee4fbe8738fbae3d Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest_kubernetes/rally')
-rw-r--r--functest_kubernetes/rally/rally_kubernetes.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/functest_kubernetes/rally/rally_kubernetes.py b/functest_kubernetes/rally/rally_kubernetes.py
index 3543fa99..ef7949ef 100644
--- a/functest_kubernetes/rally/rally_kubernetes.py
+++ b/functest_kubernetes/rally/rally_kubernetes.py
@@ -65,7 +65,8 @@ class RallyKubernetes(testcase.TestCase):
result['existing@kubernetes']['message'])
return
with open(pkg_resources.resource_filename(
- 'functest_kubernetes', 'rally/all-in-one.yaml')) as file:
+ 'functest_kubernetes', 'rally/all-in-one.yaml'),
+ encoding='utf-8') as file:
template = Template(file.read())
task = yaml.safe_load(template.render(
concurrency=kwargs.get("concurrency", self.concurrency),
@@ -90,7 +91,7 @@ class RallyKubernetes(testcase.TestCase):
self.res_dir, "{}.html".format(self.case_name)))
if "files" in result:
for path in result["files"]:
- with open(path, "w+") as output:
+ with open(path, "w+", encoding='utf-8') as output:
output.write(result["files"][path])
result = rapi.task.export(
[task_instance["uuid"]], "junit-xml",
@@ -98,6 +99,6 @@ class RallyKubernetes(testcase.TestCase):
self.res_dir, "{}.xml".format(self.case_name)))
if "files" in result:
for path in result["files"]:
- with open(path, "w+") as output:
+ with open(path, "w+", encoding='utf-8') as output:
output.write(result["files"][path])
self.stop_time = time.time()