[yum-cvs] yum yum-updatesd.py,1.31,1.32

James Bowes jbowes at linux.duke.edu
Tue Jan 9 03:58:57 UTC 2007


Update of /home/groups/yum/cvs/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv17247

Modified Files:
	yum-updatesd.py 
Log Message:
Reduce code size on the loop attempting to doLock for yum-updatesd.

Index: yum-updatesd.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum-updatesd.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- yum-updatesd.py	9 Jan 2007 03:57:47 -0000	1.31
+++ yum-updatesd.py	9 Jan 2007 03:58:55 -0000	1.32
@@ -467,20 +467,16 @@
             
         # try to get the lock so we can update the info.  fall back to
         # cached if available or try a few times.
-        tries = 0
-        while tries < 10:
+        for i in range(10):
             try:
                 self.doLock()
                 break
             except yum.Errors.LockError:
-                pass
-            # if we can't get the lock, return what we have if we can
-            if self.updateInfo:
-                return self.updateInfo
-            time.sleep(1)
-            tries += 1
-        if tries == 10:
-            self.doUnlock()
+                # if we can't get the lock, return what we have if we can
+                if self.updateInfo:
+                    return self.updateInfo
+                time.sleep(1)
+        else:
             return []
 
         try:




More information about the Yum-cvs-commits mailing list