X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Ftransitions.py;h=a214337e5a0288d3e8f1ee46d04e3798d747b47e;hb=b612f3da207fa0d75a5d3b204ac8f02bb244231a;hp=4327f5b2ecfd563a06b0f1b005dde095c6297154;hpb=4239c56e93b0e6cc7513a598812ff200d0becab8;p=dak.git diff --git a/dak/transitions.py b/dak/transitions.py index 4327f5b2..a214337e 100755 --- a/dak/transitions.py +++ b/dak/transitions.py @@ -85,9 +85,7 @@ def init(): if Options["help"]: usage() - whoami = os.getuid() - whoamifull = pwd.getpwuid(whoami) - username = whoamifull[0] + username = utils.getusername() if username != "dak": print "Non-dak user: %s" % username Options["sudo"] = "y" @@ -452,8 +450,9 @@ def check_transitions(transitions): elif answer == 'y': print "Committing" subst = {} + subst['__SUBJECT__'] = "Transitions completed: " + ", ".join(sorted(to_remove)) subst['__TRANSITION_MESSAGE__'] = "The following transitions were removed:\n" - for remove in to_remove: + for remove in sorted(to_remove): subst['__TRANSITION_MESSAGE__'] += info[remove] + '\n' del transitions[remove] @@ -465,7 +464,7 @@ def check_transitions(transitions): subst['__DAK_ADDRESS__'] = Cnf["Dinstall::MyEmailAddress"] subst['__BCC__'] = 'X-DAK: dak transitions' if Cnf.has_key("Dinstall::Bcc"): - subst["__BCC__"] += '\nBcc: %s' % Cnf["Dinstall:Bcc"] + subst["__BCC__"] += '\nBcc: %s' % Cnf["Dinstall::Bcc"] message = utils.TemplateSubst(subst, os.path.join(Cnf["Dir::Templates"], 'transition.removed')) utils.send_mail(message)