fedora-accounts cvsacct.sql,1.18,1.19 export-bugzilla.py,1.10,1.11

Toshio Ernie Kuratomi (toshio) fedora-extras-commits at redhat.com
Sat Aug 25 18:47:08 UTC 2007


Author: toshio

Update of /cvs/fedora/fedora-accounts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv852

Modified Files:
	cvsacct.sql export-bugzilla.py 
Log Message:
grant fedora users access to bugzilla_queue so export-bugzilla will work.
Update for changes introduced by the bugzilla migration.
Fix xmlrpc calls to use the proper namespace.
Enter the correct xmlrpc error strings.
Fix bugzilla_queue delete.



Index: cvsacct.sql
===================================================================
RCS file: /cvs/fedora/fedora-accounts/cvsacct.sql,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- cvsacct.sql	23 Aug 2007 22:45:13 -0000	1.18
+++ cvsacct.sql	25 Aug 2007 18:47:06 -0000	1.19
@@ -115,5 +115,5 @@
 -- 		  	 (SELECT id FROM project_group WHERE name = 'cla_done'),
 -- 			 'administrator', NULL, 'approved', NULL, NULL);
 
--- GRANT ALL ON TABLE person, project_group, role, id_seq TO GROUP fedora;
+-- GRANT ALL ON TABLE person, project_group, role, id_seq, bugzilla_queue TO GROUP fedora;
 -- GRANT SELECT ON TABLE person, project_group, role TO PUBLIC;


Index: export-bugzilla.py
===================================================================
RCS file: /cvs/fedora/fedora-accounts/export-bugzilla.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- export-bugzilla.py	23 Aug 2007 23:32:25 -0000	1.10
+++ export-bugzilla.py	25 Aug 2007 18:47:06 -0000	1.11
@@ -6,7 +6,7 @@
 import xmlrpclib
 
 BZSERVER = 'https://bugdev.devel.redhat.com/bugzilla-cvs/xmlrpc.cgi'
-#BZSERVER = 'https://bugzilla.redhat.com/bugzilla/xmlrpc.cgi'
+#BZSERVER = 'https://bugzilla.redhat.com/xmlrpc.cgi'
 BZUSER=''
 BZPASS=''
 
@@ -23,7 +23,7 @@
     # Set up the connection to our servers
     dbh = website.get_dbh(dbctx='live')
     dbc = dbh.cursor()
-    server = xmlrpclib.Server(bzServer)
+    server = xmlrpclib.Server(BZSERVER)
 
     # Select all queued bugzilla changes for this group
     qry = "SELECT p.email, p.human_name, b.action, p.id, g.id" \
@@ -37,10 +37,10 @@
         if record[2] == 'r':
             # Remove the user's bugzilla group
             try:
-                server.updatePerms(record[0], 'remove', (bz_group,),
+                server.bugzilla.updatePerms(record[0], 'remove', (bz_group,),
                         BZUSER, BZPASS)
             except xmlrpclib.Fault, e:
-                if e.faultString.startswith('No such user'):
+                if e.faultString.startswith('User Does Not Exist:'):
                     # It's okay, not having this user is equivalent to setting
                     # them to not have this group.
                     pass
@@ -50,22 +50,23 @@
         elif record[2] == 'a':
             # Try to create the user
             try:
-                server.addUser(record[0], record[1], BZUSER, BZPASS)
+                server.bugzilla.addUser(record[0], record[1], BZUSER, BZPASS)
             except xmlrpclib.Fault, e:
-                ### FIXME: We want to make sure the error is for user already exists
-                if e.faultString.startswith('User exists'):
+                if e.faultString.startswith('User Already Exists:'):
                     # It's okay, we just need to make sure the user has an
                     # account.
                     pass
                 else:
+                    print record[0],record[1]
                     raise
-            server.updatePerms(record[0], 'add', (bz_group,), BZuSER, BZPASS)
+            server.bugzilla.updatePerms(record[0], 'add', (bz_group,),
+                    BZUSER, BZPASS)
         else:
             print 'Unrecognized action code: %s %s %s %s %s' % (record[2],
                     record[0], record[1], record[3], record[4])
         
         # Remove them from the queue
-        dbc.execute("delete from bugzilla_queue as b"
-            " where b.person_id = %s and b.project_group_id = %s",
-            record[3], record[4])
+        dbc.execute("delete from bugzilla_queue"
+            " where person_id = %s and project_group_id = %s",
+            (record[3], record[4]))
         dbh.commit()




More information about the fedora-extras-commits mailing list