]> git.decadent.org.uk Git - dak.git/commitdiff
Remove use of Dir::Queue::Unchecked in config file
authorMark Hymers <mhy@debian.org>
Fri, 29 Jul 2011 08:28:41 +0000 (09:28 +0100)
committerMark Hymers <mhy@debian.org>
Fri, 29 Jul 2011 08:28:41 +0000 (09:28 +0100)
Signed-off-by: Mark Hymers <mhy@debian.org>
dak/clean_queues.py

index 31cf86f25d017d3ad034ea8d5e734c964b445c10..1123494bb7f580ce6a3de538b810ce811c8bda61 100755 (executable)
@@ -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):