]> git.decadent.org.uk Git - dak.git/commitdiff
Use the same session when getting pool entries, otherwise we can't do poolfile.location
authorChris Lamb <lamby@debian.org>
Thu, 29 Oct 2009 13:38:56 +0000 (13:38 +0000)
committerChris Lamb <lamby@debian.org>
Thu, 29 Oct 2009 13:38:56 +0000 (13:38 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
daklib/queue.py

index 0b45b284a0c0296de59f43b918501efe9110c03e..f64e8ae6bd9f3501668f225de8a904fef80f2555 100755 (executable)
@@ -1234,10 +1234,11 @@ class Upload(object):
                 os.symlink(path, os.path.join(target_dir, filename))
                 return True
 
+            session = DBConn().session()
             found = False
 
             # Look in the pool
-            for poolfile in get_poolfile_like_name('/%s' % filename):
+            for poolfile in get_poolfile_like_name('/%s' % filename, session):
                 poolfile_path = os.path.join(
                     poolfile.location.path, poolfile.filename
                 )
@@ -1246,6 +1247,8 @@ class Upload(object):
                     found = True
                     break
 
+            session.close()
+
             if found:
                 continue