Skip to content

Commit

Permalink
master/status/mail: Use distinct filenames for the e-mail build summary
Browse files Browse the repository at this point in the history
When buildSetSummary is set, use distinct filenames for the
attachments so it's clear which attachment belongs to which builder.
  • Loading branch information
Markos Chandras committed Apr 3, 2014
1 parent 9411c20 commit 831f43f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion master/buildbot/status/mail.py
Expand Up @@ -693,6 +693,14 @@ def createEmail(self, msgdict, builderName, title, results, builds=None,
log.getName())
if (self._shouldAttachLog(log.getName()) or
self._shouldAttachLog(name)):
# Use distinct filenames for the e-mail summary
if self.buildSetSummary:
filename="%s.%s.%s" % (log.getStep().getBuild().getBuilder().getName(),
log.getStep().getName(),
log.getName())
else:
filename=name

text = log.getText()
if not isinstance(text, unicode):
# guess at the encoding, and use replacement symbols
Expand All @@ -701,7 +709,7 @@ def createEmail(self, msgdict, builderName, title, results, builds=None,
a = MIMEText(text.encode(ENCODING),
_charset=ENCODING)
a.add_header('Content-Disposition', "attachment",
filename=name)
filename=filename)
m.attach(a)

#@todo: is there a better way to do this?
Expand Down

0 comments on commit 831f43f

Please sign in to comment.