X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Frm.py;h=e8d2590046eb16838764d6c3531b72302c4d0866;hb=0966aa21080d4bb09fc70a67313219d64cb05ddf;hp=7377f23b5b7236382e67d002005e71ac0932d800;hpb=0728f1b55afc80016fe27fada8dc78e635d26c60;p=dak.git diff --git a/dak/rm.py b/dak/rm.py index 7377f23b..e8d25900 100755 --- a/dak/rm.py +++ b/dak/rm.py @@ -335,10 +335,14 @@ 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: - carbon_copy.append(package + "@" + cnf["Dinstall::PackagesServer"]) + if cnf.has_key("Dinstall::PackagesServer"): + carbon_copy.append(package + "@" + cnf["Dinstall::PackagesServer"]) if cnf.has_key("Dinstall::TrackingServer"): carbon_copy.append(package + "@" + cnf["Dinstall::TrackingServer"]) elif '@' in copy_to: @@ -585,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"]