From: Kefu Chai Date: Wed, 3 Jun 2020 01:39:26 +0000 (+0800) Subject: qa/tasks/vstart_runner: do not teardown test_path if "create-cluster-only" X-Git-Tag: wip-pdonnell-testing-20200918.022351~1095^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=954e9a6fa67cce8e3eb8105ee858340b60b84b15;p=ceph-ci.git qa/tasks/vstart_runner: do not teardown test_path if "create-cluster-only" otherwise we could be removing a "None" directory when tearing down the cluster, and have following failure: Exception ignored in: > Traceback (most recent call last): File "../qa/tasks/vstart_runner.py", line 1189, in __del__ shutil.rmtree(self.teuthology_config['test_path']) File "/tmp/tmp.mmM2ugspuR/venv/lib/python3.6/shutil.py", line 477, in rmtree onerror(os.lstat, path, sys.exc_info()) File "/tmp/tmp.mmM2ugspuR/venv/lib/python3.6/shutil.py", line 475, in rmtree orig_st = os.lstat(path) TypeError: lstat: path should be string, bytes or os.PathLike, not NoneType Signed-off-by: Kefu Chai --- diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index 0e5f5d3afa2..aae37a187d5 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -1186,7 +1186,10 @@ class LocalContext(object): self.daemons.daemons[prefixed_type][svc_id] = LocalDaemon(svc_type, svc_id) def __del__(self): - shutil.rmtree(self.teuthology_config['test_path']) + test_path = self.teuthology_config['test_path'] + # opt_create_cluster_only does not create the test path + if test_path: + shutil.rmtree(test_path) def teardown_cluster(): log.info('\ntearing down the cluster...')