From: Chris Lamb Date: Thu, 29 Oct 2009 13:38:56 +0000 (+0000) Subject: Use the same session when getting pool entries, otherwise we can't do poolfile.location X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=c629ed1c07ab3257926520c065bff763bb54f47d;hp=8987bb47593698bf819ffc40ac3de2953d16168c;p=dak.git Use the same session when getting pool entries, otherwise we can't do poolfile.location Signed-off-by: Chris Lamb --- diff --git a/daklib/queue.py b/daklib/queue.py index 0b45b284..f64e8ae6 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -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