Signed-off-by: Mark Hymers <mhy@debian.org>
def get_version_checks(suite_name, check = None, session = None):
suite = get_suite(suite_name, session)
if not suite:
- return None
+ # Make sure that what we return is iterable so that list comprehensions
+ # involving this don't cause a traceback
+ return []
q = session.query(VersionCheck).filter_by(suite=suite)
if check:
q = q.filter_by(check=check)
# Check versions for each target suite
for target_suite in self.pkg.changes["distribution"].keys():
+ # Check we can find the target suite
+ ts = get_suite(target_suite)
+ if ts is None:
+ self.rejects.append("Cannot find target suite %s to perform version checks" % target_suite)
+ continue
+
must_be_newer_than = [ vc.reference.suite_name for vc in get_version_checks(target_suite, "MustBeNewerThan") ]
must_be_older_than = [ vc.reference.suite_name for vc in get_version_checks(target_suite, "MustBeOlderThan") ]