diff options
Diffstat (limited to 'cloudinit/cmd/clean.py')
-rw-r--r-- | cloudinit/cmd/clean.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/cmd/clean.py b/cloudinit/cmd/clean.py index 81797b1c..de22f7f2 100644 --- a/cloudinit/cmd/clean.py +++ b/cloudinit/cmd/clean.py @@ -10,7 +10,8 @@ import sys from cloudinit.stages import Init from cloudinit.util import ( - ProcessExecutionError, chdir, del_dir, del_file, get_config_logfiles, subp) + ProcessExecutionError, chdir, del_dir, del_file, get_config_logfiles, + is_link, subp) def error(msg): @@ -65,7 +66,7 @@ def remove_artifacts(remove_logs, remove_seed=False): if path == 'seed' and not remove_seed: continue try: - if os.path.isdir(path): + if os.path.isdir(path) and not is_link(path): del_dir(path) else: del_file(path) |