diff --git a/lib/core/purge.py b/lib/core/purge.py index 345655032..007822de5 100644 --- a/lib/core/purge.py +++ b/lib/core/purge.py @@ -75,4 +75,8 @@ def purge(directory): logger.debug("deleting the whole directory tree") os.chdir(os.path.join(directory, "..")) - shutil.rmtree(directory) + + try: + shutil.rmtree(directory) + except OSError, ex: + logger.error("problem occurred while removing directory '%s' ('%s')" % (directory, ex))