Fix missing dirs cleanup.

This commit is contained in:
Darko Poljak 2017-09-10 23:08:21 +02:00
commit 1ae5b1732e
3 changed files with 5 additions and 1 deletions

View file

@ -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):