From 622c488469a1a5cf62a980e8d6f6ed3c0896f5a4 Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Fri, 29 Jul 2011 09:28:41 +0100 Subject: [PATCH] Remove use of Dir::Queue::Unchecked in config file Signed-off-by: Mark Hymers --- dak/clean_queues.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dak/clean_queues.py b/dak/clean_queues.py index 31cf86f2..1123494b 100755 --- a/dak/clean_queues.py +++ b/dak/clean_queues.py @@ -38,6 +38,7 @@ import apt_pkg from daklib import utils from daklib import daklog from daklib.config import Config +from daklib.dbconn import get_policy_queue ################################################################################ @@ -79,8 +80,15 @@ def init (cnf): # Move to the directory to clean incoming = Options["Incoming"] if incoming == "": - incoming = cnf["Dir::Queue::Unchecked"] - os.chdir(incoming) + incoming_queue = get_policy_queue('unchecked') + if not incoming_queue: + utils.fubar("Cannot find 'unchecked' queue") + incoming = incoming_queue.path + + try: + os.chdir(incoming) + except OSError, e: + utils.fubar("Cannot chdir to %s" % incoming) # Remove a file to the morgue def remove (from_dir, f): -- 2.39.5