From bdb35b7822ca8650dbcfb233bc9302a1f3126607 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Tue, 31 May 2011 11:31:21 -0400 Subject: [PATCH] fix remove() on symlink-to-dir --- src/pylorax/sysutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pylorax/sysutils.py b/src/pylorax/sysutils.py index 219819df..d35906c5 100644 --- a/src/pylorax/sysutils.py +++ b/src/pylorax/sysutils.py @@ -99,7 +99,7 @@ def mvfile(src, dst): return dst def remove(target): - if os.path.isdir(target): + if os.path.isdir(target) and not os.path.islink(target): shutil.rmtree(target) else: os.unlink(target)