X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Frm.py;h=e0a5fa79d73653d538067f0947330222cae109e3;hb=a8665e557ea0b9eaec99badfc2c746303e0acfbe;hp=2e023b7e0e0043c8c9bc342ad3c70806cb7c7f10;hpb=4c2f7648021d1db257d4630b25158718fef66b56;p=dak.git diff --git a/dak/rm.py b/dak/rm.py index 2e023b7e..e0a5fa79 100755 --- a/dak/rm.py +++ b/dak/rm.py @@ -102,7 +102,7 @@ def reverse_depends_check(removals, suites, arches=None): cnf = Config() print "Checking reverse dependencies..." - components = cnf.ValueList("Suite::%s::Components" % suites[0]) + components = get_component_names() dep_problem = 0 p2c = {} all_broken = {} @@ -335,7 +335,10 @@ def main (): carbon_copy = [] for copy_to in utils.split_args(Options.get("Carbon-Copy")): if copy_to.isdigit(): - carbon_copy.append(copy_to + "@" + cnf["Dinstall::BugServer"]) + if cnf.has_key("Dinstall::BugServer"): + carbon_copy.append(copy_to + "@" + cnf["Dinstall::BugServer"]) + else: + utils.fubar("Asked to send mail to #%s in BTS but Dinstall::BugServer is not configured" % copy_to) elif copy_to == 'package': for package in arguments: if cnf.has_key("Dinstall::PackagesServer"): @@ -586,6 +589,19 @@ def main (): session.commit() print "done." + # If we don't have a Bug server configured, we're done + if not cnf.has_key("Dinstall::BugServer"): + if Options["Done"] or Options["Do-Close"]: + print "Cannot send mail to BugServer as Dinstall::BugServer is not configured" + + logfile.write("=========================================================================\n") + logfile.close() + + logfile822.write("\n") + logfile822.close() + + return + # read common subst variables for all bug closure mails Subst_common = {} Subst_common["__RM_ADDRESS__"] = cnf["Dinstall::MyEmailAddress"] @@ -614,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"]: