if cnf.FindB("Dinstall::SecurityQueueHandling"):
upload.dump_vars(cnf["Dir::Queue::Embargoed"])
- upload.move_to_queue(get_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
__all__.append('BuildQueue')
@session_wrapper
-def get_queue(queuename, session=None):
+def get_build_queue(queuename, session=None):
"""
- Returns Queue object for given C{queue name}, creating it if it does not
+ Returns BuildQueue object for given C{queue name}, creating it if it does not
exist.
@type queuename: string
@param session: Optional SQLA session object (a temporary one will be
generated if not supplied)
- @rtype: Queue
- @return: Queue object for the given queue
+ @rtype: BuildQueue
+ @return: BuildQueue object for the given queue
"""
- q = session.query(Queue).filter_by(queue_name=queuename)
+ q = session.query(BuildQueue).filter_by(queue_name=queuename)
try:
return q.one()
except NoResultFound:
return None
-__all__.append('get_queue')
+__all__.append('get_build_queue')
################################################################################
__all__.append('PolicyQueue')
+@session_wrapper
+def get_policy_queue(queuename, session=None):
+ """
+ Returns PolicyQueue object for given C{queue name}
+
+ @type queuename: string
+ @param queuename: The name of the queue
+
+ @type session: Session
+ @param session: Optional SQLA session object (a temporary one will be
+ generated if not supplied)
+
+ @rtype: PolicyQueue
+ @return: PolicyQueue object for the given queue
+ """
+
+ q = session.query(PolicyQueue).filter_by(queue_name=queuename)
+
+ try:
+ return q.one()
+ except NoResultFound:
+ return None
+
+__all__.append('get_policy_queue')
+
################################################################################
class Priority(object):
def do_byhand(u, summary, short_summary, chg, session):
return package_to_queue(u, summary, short_summary,
- get_queue('byhand'), chg, session,
+ get_policy_queue('byhand'), chg, session,
announce=None)
################################################################################
print "Moving to NEW queue."
u.logger.log(["Moving to new", u.pkg.changes_file])
- q = get_queue('new', session)
+ q = get_policy_queue('new', session)
u.move_to_queue(q)
chg.in_queue = q.queue_id