[Collab-qa-commits] r1522 - udd

Lucas Nussbaum lucas at alioth.debian.org
Fri Jul 17 02:55:39 UTC 2009


Author: lucas
Date: 2009-07-17 02:55:38 +0000 (Fri, 17 Jul 2009)
New Revision: 1522

Modified:
   udd/udd.py
Log:
use one transaction per target (makes it more likely that we can commit something at all)

Modified: udd/udd.py
===================================================================
--- udd/udd.py	2009-07-16 19:00:46 UTC (rev 1521)
+++ udd/udd.py	2009-07-17 02:55:38 UTC (rev 1522)
@@ -35,8 +35,6 @@
 
   types = config['general']['types']
 
-  connection = udd.aux.open_connection(config)
-
   schemata = {}
   # Process the sources
   for src in sys.argv[3:]:
@@ -61,6 +59,7 @@
 	if src_command == "exec":
 	  system(rest + " " + sys.argv[1] + " " + sys.argv[2] + " " + src)
 	elif src_command == "module":
+          connection = udd.aux.open_connection(config)
           # TODO XXX: using exec is hackish and prone to failures due
           # to what is being written in the conffile. We should get
           # rid of these lines and use the "imp" module, which is
@@ -73,6 +72,7 @@
 	    print "\n".join(tables)
 	  else:
 	    exec "gatherer.%s()" % command
+	  connection.commit()
 	if 'timestamp-dir' in config['general']:
 	  f = open(os.path.join(config['general']['timestamp-dir'],
                                 src+".dispatch"), "w")
@@ -82,4 +82,3 @@
       udd.aux.unlock(config, src)
       raise
     udd.aux.unlock(config, src)
-  connection.commit()




More information about the Collab-qa-commits mailing list