[yum-commits] plugins/fastestmirror

James Antill james at osuosl.org
Wed Nov 24 14:40:15 UTC 2010


 plugins/fastestmirror/fastestmirror.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit aa9d580b840d4f50a9f25368a22f8bb25737504a
Author: James Antill <james at and.org>
Date:   Wed Nov 24 09:39:58 2010 -0500

    Don't crash when we can't unlink the hostfilepath. BZ 650468.

diff --git a/plugins/fastestmirror/fastestmirror.py b/plugins/fastestmirror/fastestmirror.py
index 37969f8..364b90d 100644
--- a/plugins/fastestmirror/fastestmirror.py
+++ b/plugins/fastestmirror/fastestmirror.py
@@ -119,7 +119,10 @@ def clean_hook(conduit):
         hostfilepath = conduit._base.conf.cachedir + '/' + hostfilepath
     if os.path.exists(hostfilepath):
         conduit.info(2, "Cleaning up list of fastest mirrors")
-        os.unlink(hostfilepath)
+        try:
+            os.unlink(hostfilepath)
+        except Exception, e:
+            conduit.info(2, "Cleanup failed: %s" % e)
 
 # Get the hostname from a url, stripping away any usernames/passwords
 host = lambda mirror: mirror.split('/')[2].split('@')[-1]


More information about the Yum-commits mailing list