check-mirrors return-mirrorlist.py,1.14,1.15

Michael Patrick McGrath (mmcgrath) fedora-extras-commits at redhat.com
Fri Aug 11 16:23:04 UTC 2006


Author: mmcgrath

Update of /cvs/fedora/check-mirrors
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15204

Modified Files:
	return-mirrorlist.py 
Log Message:
Fixed bad checks on arch variable.



Index: return-mirrorlist.py
===================================================================
RCS file: /cvs/fedora/check-mirrors/return-mirrorlist.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- return-mirrorlist.py	7 Aug 2006 03:01:42 -0000	1.14
+++ return-mirrorlist.py	11 Aug 2006 16:23:01 -0000	1.15
@@ -69,7 +69,10 @@
             return(conn, cursor)
     
     def getMirrors(self, repo, arch, country):
-
+#        if(arch.lower() != 'i386' || arch.lower() != 'ppc' || arch.lower() != 'x86_64'):
+#            print "# %s is not a valid arch" % arch
+#            return False
+            
         if country.lower() == 'global':
             countrysql = ""
         else:
@@ -109,7 +112,7 @@
         for row in self.dbcursor.fetchall():
             totalChecks = row[5] + row[6] * 1.0
             good = 0.0
-            good = (row[5] / totalChecks * 1.0) * 100
+            good = (row[6] / totalChecks * 1.0) * 100
             print '# %s' % row[4]
             print '# Country: %s' % row[3]
             print '# Last Good: %s' % row[8]
@@ -117,7 +120,6 @@
             print '# Valid: %i' % row[7]
             print '# -----------------------------------'
         return True
-                
 
     def close(self):
         self.dbconn.cursor()
@@ -161,9 +163,9 @@
         msg = "# Path: %s for repo %s does not exist" % (config.paths[repo], repo)
         errors.append(msg)
         return errors
-    
-    if not form.has_key('arch') or not form['arch'].value:
-        msg = "# no arch specified"
+    if not form.has_key('arch') or not (form['arch'].value.__eq__('i386') or form['arch'].value.__eq__('ppc') or form['arch'].value.__eq__('x86_64')):
+        # or not form['arch'].value.__eq__('ppc') or not form['arch'].value.__eq__('x86_64'):
+        msg = "# no arch specified\n# Valid archs: i386, ppc, x86_64"
         errors.append(msg)
         return errors
     return errors
@@ -190,12 +192,12 @@
     
     lists_path = config.paths[repo]
     prefix = config.prefixes[repo]
-    
+
     # get geoip resolution
     # if country-specific file exists
        # open and return
     # otherwise return global
-    
+
     country_specified = False
     country_list = []
     if not form.has_key('country'):
@@ -233,7 +235,7 @@
         if not os.path.exists(return_file):
             print '# no file found for repo = %s, country = %s, arch = %s' % (repo, country, arch)
             print '# filename was: %s' % os.path.basename(return_file)
-            continue
+#            continue
 
         print '# repo = %s country = %s arch = %s ' % (repo, country, arch)
         DB.printMirrors(repo, arch, country)




More information about the scm-commits mailing list