- print "ACCEPT\n" + pi + summary,
- prompt = "[A]ccept, Skip, Quit ?"
- if Options["Automatic"]:
- answer = 'A'
+ # Does suite have a policy_queue configured
+ divert = False
+ for s in u.pkg.changes["distribution"].keys():
+ suite = get_suite(s, session)
+ if suite.policy_queue:
+ if not chg or chg.approved_for_id != suite.policy_queue.policy_queue_id:
+ # This routine will check whether the upload is a binary
+ # upload when the source is already in the target suite. If
+ # so, we skip the policy queue, otherwise we go there.
+ divert = package_to_suite(u, suite.suite_name, session=session)
+ if divert:
+ print "%s for %s\n%s%s" % ( suite.policy_queue.queue_name.upper(),
+ ", ".join(u.pkg.changes["distribution"].keys()),
+ pi, summary)
+ queuekey = "P"
+ prompt = "[P]olicy, Skip, Quit ?"
+ policyqueue = suite.policy_queue
+ if Options["Automatic"]:
+ answer = 'P'
+ break
+
+ if not divert:
+ print "ACCEPT\n" + pi + summary,
+ prompt = "[A]ccept, Skip, Quit ?"
+ if Options["Automatic"]:
+ answer = 'A'