Repository: mesos Updated Branches: refs/heads/master 1a82a3fb2 -> 406d72ed0
Fixed post-reviews.py hanging bug. If you're not logged into ReviewBoard and run `post-reviews.py` the script hangs when trying to create a diff. After pressing enter, if you're not logged in, you get the following error message: ``` ... Press enter to continue or 'Ctrl-C' to skip. Please log in to the Review Board server at reviews.apache.org. You can either: (1) Run 'rbt login', or (2) Set the default USERNAME/PASSWORD in '.reviewboardrc' ``` Review: https://reviews.apache.org/r/35771 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/406d72ed Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/406d72ed Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/406d72ed Branch: refs/heads/master Commit: 406d72ed09316c1f9e004447592e5fcbdd911fb4 Parents: 1a82a3f Author: Michael Park <[email protected]> Authored: Tue Jun 23 22:14:32 2015 +0200 Committer: Till Toenshoff <[email protected]> Committed: Tue Jun 23 22:19:47 2015 +0200 ---------------------------------------------------------------------- support/post-reviews.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/406d72ed/support/post-reviews.py ---------------------------------------------------------------------- diff --git a/support/post-reviews.py b/support/post-reviews.py index 10861a9..92f565c 100755 --- a/support/post-reviews.py +++ b/support/post-reviews.py @@ -44,12 +44,20 @@ def execute(command, ignore_errors=False): raise return None - data = process.stdout.read() + data, error = process.communicate() status = process.wait() if status != 0 and not ignore_errors: cmdline = ' '.join(command) if isinstance(command, list) else command - print 'Failed to execute: \'' + cmdline + '\':' - print data + need_login = \ + 'Please log in to the Review Board server at reviews.apache.org.' + if need_login in data: + print need_login, '\n' + print "You can either:" + print " (1) Run 'rbt login', or" + print " (2) Set the default USERNAME/PASSWORD in '.reviewboardrc'" + else: + print 'Failed to execute: \'' + cmdline + '\':' + print data sys.exit(1) elif status != 0: return None
