Skip to content

Commit

Permalink
Don't add a newline to force-build reasons
Browse files Browse the repository at this point in the history
And also make MailNotifier a bit more resilient to newlines in the
reason.  Fixes #2285.
  • Loading branch information
djmitche committed Apr 22, 2012
1 parent 342362f commit da0c97e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion master/buildbot/schedulers/forcesched.py
Expand Up @@ -283,7 +283,7 @@ def forceWithWebRequest(self, owner, builder_name, req):

real_properties.setProperty("owner", owner, "Force Build Form")

r = ("The web-page 'force build' button was pressed by '%s': %s\n"
r = ("The web-page 'force build' button was pressed by '%s': %s"
% (owner, reason))

d = master.db.sourcestampsets.addSourceStampSet()
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/status/mail.py
Expand Up @@ -496,7 +496,7 @@ def getCustomMesgData(self, mode, name, build, results, master_status):
'buildText': build.getText(),
'buildProperties': build.getProperties(),
'slavename': build.getSlavename(),
'reason': build.getReason(),
'reason': build.getReason().replace('\n', ''),
'responsibleUsers': build.getResponsibleUsers(),
'branch': "",
'revision': "",
Expand Down
4 changes: 2 additions & 2 deletions master/buildbot/test/unit/test_schedulers_forcesched.py
Expand Up @@ -124,7 +124,7 @@ def check(res):
self.db.buildsets.assertBuildset\
(bsid,
dict(reason="The web-page 'force build' button was pressed by"
" 'user': because\n",
" 'user': because",
brids=brids,
external_idstring=None,
properties=[ ('owner', ('user', 'Force Build Form')),
Expand Down Expand Up @@ -160,7 +160,7 @@ def check(res):
self.db.buildsets.assertBuildset\
(bsid,
dict(reason="The web-page 'force build' button was pressed "
"by 'user': because\n",
"by 'user': because",
brids=brids,
external_idstring=None,
properties=[
Expand Down

0 comments on commit da0c97e

Please sign in to comment.