[yum-cvs] plugins/fastestmirror

Luke Macken lmacken at linux.duke.edu
Wed Aug 8 21:52:11 UTC 2007


 plugins/fastestmirror/ChangeLog        |    5 +++++
 plugins/fastestmirror/fastestmirror.py |   13 ++++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 32a1a2a023b47ef8ac9e48e61ba07cd8bf3a32f1
Author: Luke Macken <lmacken at crow.(none)>
Date:   Wed Aug 8 17:52:07 2007 -0400

    - Add patch from Christopher Aillon to fail quietly when fastestmirror does
      not have write access to the timed hostfile.
      https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=237034

diff --git a/plugins/fastestmirror/ChangeLog b/plugins/fastestmirror/ChangeLog
index 65b0af9..dc9af60 100644
--- a/plugins/fastestmirror/ChangeLog
+++ b/plugins/fastestmirror/ChangeLog
@@ -1,3 +1,8 @@
+* Aug  8 2007 Luke Macken <lmacken at redhat.com> - 0.2.8
+- Add patch from Christopher Aillon to fail quietly when fastestmirror does
+  not have write access to the timed hostfile.
+  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=237034
+
 * Apr 19 2007 Luke Macken <lmacken at redhat.com> - 0.2.7
 - Remove TYPE_{INTERFACE,INTERACTIVE}
 
diff --git a/plugins/fastestmirror/fastestmirror.py b/plugins/fastestmirror/fastestmirror.py
index f2eba80..cfa7467 100644
--- a/plugins/fastestmirror/fastestmirror.py
+++ b/plugins/fastestmirror/fastestmirror.py
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Version: 0.2.7
+# Version: 0.2.8
 #
 # A plugin for the Yellowdog Updater Modified which sorts each repo's
 # mirrorlist by connection speed prior to download.
@@ -98,10 +98,13 @@ def read_timedhosts():
 
 def write_timedhosts():
     global timedhosts
-    hostfile = file(hostfilepath, 'w')
-    for host in timedhosts.keys():
-        hostfile.write('%s %s\n' % (host, timedhosts[host]))
-    hostfile.close()
+    try:
+        hostfile = file(hostfilepath, 'w')
+        for host in timedhosts.keys():
+            hostfile.write('%s %s\n' % (host, timedhosts[host]))
+        hostfile.close()
+    except IOError:
+        pass
 
 def get_hostfile_age():
     global hostfilepath



More information about the Yum-cvs-commits mailing list