From b8a54f3492341b5fe6d754374927cb52fb03ae49 Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Sat, 8 Nov 2014 15:35:34 +0000 Subject: [PATCH] Find suite by any of the random name types we have Signed-off-by: Mark Hymers --- daklib/dbconn.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 535c7f8e..4d1035c2 100644 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -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: -- 2.39.5