cnf = Config()
(summary, short_summary) = upload.build_summaries()
+ destqueue = get_policy_queue('newstage', session)
- # XXX: mhy: I think this is wrong as these are all attributes on the
- # build and policy queues now
- if cnf.FindB("Dinstall::SecurityQueueHandling"):
- upload.dump_vars(cnf["Dir::Queue::Embargoed"])
- upload.move_to_queue(get_policy_queue('embargoed'))
- upload.queue_build("embargoed", cnf["Dir::Queue::Embargoed"])
- # Check for override disparities
- upload.Subst["__SUMMARY__"] = summary
- else:
- # Just a normal upload, accept it...
- (summary, short_summary) = upload.build_summaries()
- destqueue = get_policy_queue('newstage', session)
-
- srcqueue = get_policy_queue_from_path(upload.pkg.directory, session)
+ srcqueue = get_policy_queue_from_path(upload.pkg.directory, session)
- if not srcqueue:
- # Assume NEW and hope for the best
- srcqueue = get_policy_queue('new', session)
+ if not srcqueue:
+ # Assume NEW and hope for the best
+ srcqueue = get_policy_queue('new', session)
- changes_to_queue(upload, srcqueue, destqueue, session)
+ changes_to_queue(upload, srcqueue, destqueue, session)
__all__.append('new_accept')
if not get_policy_queue("disembargo"):
return False
+ # If we already are in newstage, then it means this just got passed through and accepted
+ # by a security team member. Don't try to accept it for disembargo again
+ dbc = get_dbchange(u.pkg.changes_file, session)
+ if dbc and dbc.in_queue.queue_name in [ 'newstage' ]:
+ return False
+
q = session.execute("SELECT package FROM disembargo WHERE package = :source AND version = :version",
{'source': u.pkg.changes["source"],
'version': u.pkg.changes["version"]})
def is_embargo(u):
# if we are the security archive, we always have a embargo queue and its the
# last in line, so if that exists, return true
+ # Of course do not return true when we accept from out of newstage, as that means
+ # it just left embargo and we want it in the archive
if get_policy_queue('embargo'):
+ session = DBConn().session()
+ dbc = get_dbchange(u.pkg.changes_file, session)
+ if dbc and dbc.in_queue.queue_name in [ 'newstage' ]:
+ return False
+
return True
def do_embargo(u, summary, short_summary, chg, session=None):