[dak/master 3/3] Remove use of Dir::Queue::Unchecked in config file
Signed-off-by: Mark Hymers <mhy@debian.org>
---
dak/clean_queues.py | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dak/clean_queues.py b/dak/clean_queues.py
index 31cf86f..1123494 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):
--
1.7.2.5
Reply to: