]> git.decadent.org.uk Git - dak.git/commitdiff
Merge commit 'lamby/master' into merge
authorJoerg Jaspert <joerg@debian.org>
Tue, 27 Oct 2009 08:36:02 +0000 (09:36 +0100)
committerJoerg Jaspert <joerg@debian.org>
Tue, 27 Oct 2009 08:36:02 +0000 (09:36 +0100)
* commit 'lamby/master':
  Avoid circular import when importing daklib.dbconn first.
  Handle arguments with default kwargs in @session_wrapper.

Signed-off-by: Joerg Jaspert <joerg@debian.org>
daklib/dbconn.py

index ee057d5c9cdff40d4ec905500fac286df5368bf6..3aa7b8e2458965f152ede8dd57b361bc72bd338a 100755 (executable)
@@ -48,7 +48,6 @@ from sqlalchemy.orm.exc import NoResultFound
 
 # Only import Config until Queue stuff is changed to store its config
 # in the database
-import utils
 from config import Config
 from singleton import Singleton
 from textutils import fix_maintainer
@@ -65,7 +64,7 @@ def session_wrapper(fn):
         session = kwargs.get('session')
 
         # No session specified as last argument or in kwargs, create one.
-        if session is None and len(args) == len(getargspec(fn)[0]) - 1:
+        if session is None or len(args) == len(getargspec(fn)[0]) - 1:
             private_transaction = True
             kwargs['session'] = DBConn().session()
 
@@ -1427,6 +1426,7 @@ class Queue(object):
                 # TODO: Move into database as above
                 if conf.FindB("Dinstall::SecurityQueueBuild"):
                     # Copy it since the original won't be readable by www-data
+                    import utils
                     utils.copy(src, dest)
                 else:
                     # Create a symlink to it