]> err.no Git - dak/commitdiff
Use database instead of config file for Archive::
authorMark Hymers <mhy@debian.org>
Wed, 27 Jul 2011 19:18:53 +0000 (20:18 +0100)
committerMark Hymers <mhy@debian.org>
Wed, 27 Jul 2011 19:18:53 +0000 (20:18 +0100)
Leave in security and bpo configs for now as they need
upgrading before they're removed.

Signed-off-by: Mark Hymers <mhy@debian.org>
config/debian/dak.conf
dak/rm.py

index 6b5e17a9db52dc157b4f063d76b55333775e3099..39379ec2c72baf435e0234b9f2e92a8312957171 100644 (file)
@@ -366,16 +366,6 @@ DB
   Unicode "false"
 };
 
-Archive
-{
-  ftp-master
-  {
-    OriginServer "ftp-master.debian.org";
-    PrimaryMirror "ftp.debian.org";
-    Description "Master Archive for the Debian project";
-  };
-};
-
 Urgency
 {
   Default "low";
index e8d2590046eb16838764d6c3531b72302c4d0866..944a46e6a0b1e5811387058e3b90743bed82a1c5 100755 (executable)
--- a/dak/rm.py
+++ b/dak/rm.py
@@ -630,10 +630,17 @@ def main ():
         summarymail = "%s\n------------------- Reason -------------------\n%s\n" % (summary, Options["Reason"])
         summarymail += "----------------------------------------------\n"
         Subst_close_rm["__SUMMARY__"] = summarymail
+
         whereami = utils.where_am_i()
-        Archive = cnf.SubTree("Archive::%s" % (whereami))
-        Subst_close_rm["__MASTER_ARCHIVE__"] = Archive["OriginServer"]
-        Subst_close_rm["__PRIMARY_MIRROR__"] = Archive["PrimaryMirror"]
+        Archive = get_archive(whereami, session)
+        if Archive is None:
+            utils.warn("Cannot find archive %s.  Setting blank values for origin" % whereami)
+            Subst_close_rm["__MASTER_ARCHIVE__"] = ""
+            Subst_close_rm["__PRIMARY_MIRROR__"] = ""
+        else:
+            Subst_close_rm["__MASTER_ARCHIVE__"] = Archive.origin_server
+            Subst_close_rm["__PRIMARY_MIRROR__"] = Archive.primary_mirror
+
         for bug in utils.split_args(Options["Done"]):
             Subst_close_rm["__BUG_NUMBER__"] = bug
             if Options["Do-Close"]: