diff --git a/cdist/config.py b/cdist/config.py index e33a6027..ed69e3e4 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -260,6 +260,10 @@ class Config(object): if len(failed_hosts) > 0: raise cdist.Error("Failed to configure the following hosts: " + " ".join(failed_hosts)) + elif not args.out_path: + # If tmp out path created then remove it, but only if no failed + # hosts. + shutil.rmtree(base_root_path) @classmethod def _resolve_ssh_control_path(cls): diff --git a/cdist/exec/local.py b/cdist/exec/local.py index 468deb4a..9f37bde2 100644 --- a/cdist/exec/local.py +++ b/cdist/exec/local.py @@ -79,7 +79,6 @@ class Local(object): self._init_log() self._init_permissions() self.mkdir(self.base_path) - # FIXME: create dir that does not require moving later self._init_cache_dir(None) self._init_paths() self._init_object_marker() diff --git a/cdist/test/exec/remote.py b/cdist/test/exec/remote.py index 723d6ddd..5137c59c 100644 --- a/cdist/test/exec/remote.py +++ b/cdist/test/exec/remote.py @@ -49,6 +49,7 @@ class RemoteTestCase(test.CdistTestCase): def tearDown(self): shutil.rmtree(self.temp_dir) + shutil.rmtree(self.base_path) # test api