Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora User (http://www.linux-archive.org/fedora-user/)
-   -   Ignore remove errors (http://www.linux-archive.org/fedora-user/582885-ignore-remove-errors.html)

Martin Gracik 10-03-2011 10:20 AM

Ignore remove errors
 
On some nfs mounts the shutil.rmtree may traceback
when removing some files. This is not such a problem
so we can ignore these errors and continue.
---
src/pylorax/yumhelper.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/pylorax/yumhelper.py b/src/pylorax/yumhelper.py
index 04ad140..904fdc2 100644
--- a/src/pylorax/yumhelper.py
+++ b/src/pylorax/yumhelper.py
@@ -117,7 +117,7 @@ class LoraxYumHelper(object):
if os.path.islink(fname) or os.path.isfile(fname):
os.unlink(fname)
else:
- shutil.rmtree(fname)
+ shutil.rmtree(fname, ignore_errors=True)

logger.debug("removed {0}".format(fname))
count += 1
--
1.7.3.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 09:50 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.