]> git.decadent.org.uk Git - dak.git/commitdiff
Find suite by any of the random name types we have
authorMark Hymers <mhy@debian.org>
Sat, 8 Nov 2014 15:35:34 +0000 (15:35 +0000)
committerMark Hymers <mhy@debian.org>
Sat, 8 Nov 2014 15:35:34 +0000 (15:35 +0000)
Signed-off-by: Mark Hymers <mhy@debian.org>
daklib/dbconn.py

index 535c7f8ecb9c749bc360ffbef35ba5efec58acf6..4d1035c2d79d33934bb11facf9445ab13f49c0c1 100644 (file)
@@ -2298,8 +2298,22 @@ def get_suite(suite, session=None):
     @return: Suite object for the requested suite name (None if not present)
     """
 
+    # Start by looking for the dak internal name
     q = session.query(Suite).filter_by(suite_name=suite)
+    try:
+        return q.one()
+    except NoResultFound:
+        pass
+
+    # Now try codename
+    q = session.query(Suite).filter_by(codename=suite)
+    try:
+        return q.one()
+    except NoResultFound:
+        pass
 
+    # Finally give release_suite a try
+    q = session.query(Suite).filter_by(release_suite=suite)
     try:
         return q.one()
     except NoResultFound: