aboutsummaryrefslogtreecommitdiffstats
path: root/functest_kubernetes/k8stest.py
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/k8stest.py
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/k8stest.py')
-rw-r--r--functest_kubernetes/k8stest.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/functest_kubernetes/k8stest.py b/functest_kubernetes/k8stest.py
index b450dac4..34c8ab94 100644
--- a/functest_kubernetes/k8stest.py
+++ b/functest_kubernetes/k8stest.py
@@ -78,7 +78,8 @@ class E2ETesting(testcase.TestCase):
cmd_line, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, env=env) as process:
boutput = process.stdout.read()
- with open(os.path.join(self.res_dir, 'e2e.log'), 'wb') as foutput:
+ with open(os.path.join(
+ self.res_dir, 'e2e.log'), 'w', encoding='utf-8') as foutput:
foutput.write(boutput)
grp = re.search(
r'^(FAIL|SUCCESS)!.* ([0-9]+) Passed \| ([0-9]+) Failed \|'
@@ -145,5 +146,6 @@ class E2ETesting(testcase.TestCase):
"GcrReleaseRegistry": "{}/gke-release".format(gcr_repo),
"MicrosoftRegistry": "mcr.microsoft.com",
}
- with open("{}/repositories.yml".format(self.res_dir), 'w') as file:
+ with open("{}/repositories.yml".format(
+ self.res_dir), 'w', encoding='utf-8') as file:
yaml.dump(repo_list, file)