aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2022-10-21 17:21:54 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2022-10-21 17:42:06 +0200
commit890384e0715548882aad63769296564f6b60a036 (patch)
treefeb773be743e4ffbb9b29623769c4fb3b5d8f153
parent28f02d0b8a248e8fd8e054916f7d3e9f637c3ff3 (diff)
Use Path.home() instead of ~
Change-Id: I5863f4e0315b67a07dab4756857dba7aa37932f0 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit d744fb5276d47fb3ba7ad2d4cb1fb2d3bfaca3eb)
-rw-r--r--functest_kubernetes/k8stest.py3
-rw-r--r--functest_kubernetes/netperf/netperf.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/functest_kubernetes/k8stest.py b/functest_kubernetes/k8stest.py
index 7bf2e7ae..39925f4b 100644
--- a/functest_kubernetes/k8stest.py
+++ b/functest_kubernetes/k8stest.py
@@ -16,6 +16,7 @@ from __future__ import division
import logging
import os
+from pathlib import Path
import re
import subprocess
import time
@@ -30,7 +31,7 @@ class E2ETesting(testcase.TestCase):
__logger = logging.getLogger(__name__)
- config = '~/.kube/config'
+ config = f'{Path.home()}/.kube/config'
gcr_repo = os.getenv("MIRROR_REPO", "gcr.io")
k8s_gcr_repo = os.getenv("MIRROR_REPO", "k8s.gcr.io")
diff --git a/functest_kubernetes/netperf/netperf.py b/functest_kubernetes/netperf/netperf.py
index 31788176..b0cd8e40 100644
--- a/functest_kubernetes/netperf/netperf.py
+++ b/functest_kubernetes/netperf/netperf.py
@@ -14,6 +14,7 @@ Benchmarking Kubernetes Networking Performance
import glob
import logging
import os
+from pathlib import Path
import shutil
import subprocess
import time
@@ -44,7 +45,7 @@ class Netperf(testcase.TestCase):
if not os.path.exists(self.res_dir):
os.makedirs(self.res_dir)
cmd = ['launch', '-iterations', '1', '-kubeConfig',
- '~/.kube/config']
+ f'{Path.home()}/.kube/config']
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
self.__logger.info("%s\n%s", " ".join(cmd), output.decode("utf-8"))
lfiles = glob.glob(os.path.join(