diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-09-11 10:24:53 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-09-11 10:55:16 +0200 |
commit | d2d72bbb71c3f772d099765ba1b06f8cf3060392 (patch) | |
tree | f7ea35807ea8a1757116507199d83cd952111515 /functest_kubernetes/ims | |
parent | 9dae8dbe3cbfcac3d0fbf4a6b4421fa7eb8b2175 (diff) |
Set encoding utf-8 when opening file
Change-Id: I4e756552173247499ba882bfee4fbe8738fbae3d
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 5a565816e30dcb5aefb2feb33acce7ef7a457cc0)
Diffstat (limited to 'functest_kubernetes/ims')
-rw-r--r-- | functest_kubernetes/ims/ims.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/functest_kubernetes/ims/ims.py b/functest_kubernetes/ims/ims.py index 18e8c0de..1feeafab 100644 --- a/functest_kubernetes/ims/ims.py +++ b/functest_kubernetes/ims/ims.py @@ -220,7 +220,8 @@ class K8sVims(Vims): for deployment in self.deployment_list: with open(pkg_resources.resource_filename( 'functest_kubernetes', - 'ims/{}-depl.yaml'.format(deployment))) as yfile: + 'ims/{}-depl.yaml'.format(deployment)), + encoding='utf-8') as yfile: template = Template(yfile.read()) body = yaml.safe_load(template.render( dockerhub_repo=os.getenv( @@ -235,7 +236,8 @@ class K8sVims(Vims): for service in self.deployment_list: with open(pkg_resources.resource_filename( 'functest_kubernetes', - 'ims/{}-svc.yaml'.format(service))) as yfile: + 'ims/{}-svc.yaml'.format(service)), + encoding='utf-8') as yfile: body = yaml.safe_load(yfile) resp = self.corev1.create_namespaced_service( body=body, namespace=self.namespace) |