Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(17799)

Issue 108930045: Fail early if brew is not installed.

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 10 months ago by bac
Modified:
9 years, 10 months ago
Reviewers:
mp+223012, frankban
Visibility:
Public.

Description

Fail early if brew is not installed. Did some refactoring to list required files for each supported platform. If required files are not found, fail early with an appropriate parser error message. https://code.launchpad.net/~bac/juju-quickstart/donde-brew/+merge/223012 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Fail early if brew is not installed. #

Total comments: 14

Patch Set 3 : Fail early if brew is not installed. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+138 lines, -60 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M quickstart/app.py View 1 1 chunk +1 line, -1 line 0 comments Download
M quickstart/manage.py View 1 2 3 chunks +15 lines, -5 lines 0 comments Download
M quickstart/platform_support.py View 1 2 3 chunks +25 lines, -11 lines 0 comments Download
M quickstart/settings.py View 1 1 chunk +3 lines, -1 line 0 comments Download
M quickstart/tests/test_app.py View 1 1 chunk +1 line, -1 line 0 comments Download
M quickstart/tests/test_manage.py View 1 3 chunks +25 lines, -14 lines 0 comments Download
M quickstart/tests/test_platform_support.py View 1 2 5 chunks +66 lines, -27 lines 0 comments Download

Messages

Total messages: 5
bac
Please take a look.
9 years, 10 months ago (2014-06-13 00:35:51 UTC) #1
frankban
Hi Brad, thanks for this. The code looks good in general, but I'm not sure ...
9 years, 10 months ago (2014-06-13 09:34:56 UTC) #2
bac
Please take a look.
9 years, 10 months ago (2014-06-13 13:51:32 UTC) #3
frankban
This branch is nice, thank you! LGTM with some changes. https://codereview.appspot.com/108930045/diff/20001/quickstart/manage.py File quickstart/manage.py (right): https://codereview.appspot.com/108930045/diff/20001/quickstart/manage.py#newcode332 ...
9 years, 10 months ago (2014-06-13 14:16:28 UTC) #4
bac
9 years, 10 months ago (2014-06-13 14:40:47 UTC) #5
*** Submitted:

Fail early if brew is not installed.

Did some refactoring to list required files for each supported platform.
If required files are not found, fail early with an appropriate parser
error message.

R=frankban
CC=
https://codereview.appspot.com/108930045

https://codereview.appspot.com/108930045/diff/20001/quickstart/manage.py
File quickstart/manage.py (right):

https://codereview.appspot.com/108930045/diff/20001/quickstart/manage.py#newc...
quickstart/manage.py:332: """Validate the platform.
On 2014/06/13 14:16:27, frankban wrote:
> """Validate the platform.
> 
> Exit with an error if platform is not supported by quickstart
> or is missing files.
> """

Done.

https://codereview.appspot.com/108930045/diff/20001/quickstart/manage.py#newc...
quickstart/manage.py:338: return parser.error(err.message.encode('utf-8'))
On 2014/06/13 14:16:27, frankban wrote:
> err.message should already be a byte string.
> Perhaps return parser.error(bytes(err))?

Done.

https://codereview.appspot.com/108930045/diff/20001/quickstart/platform_suppo...
File quickstart/platform_support.py (right):

https://codereview.appspot.com/108930045/diff/20001/quickstart/platform_suppo...
quickstart/platform_support.py:30: def validate_platform(pf):
platform clashes with the module name.  I started to do platform_ but I found it
annoying.

https://codereview.appspot.com/108930045/diff/20001/quickstart/platform_suppo...
quickstart/platform_support.py:31: """Validate the platform has the required
files installed.
On 2014/06/13 14:16:27, frankban wrote:
> Validate the platform is supported and has the required files?

Done.

https://codereview.appspot.com/108930045/diff/20001/quickstart/platform_suppo...
quickstart/platform_support.py:46: raise ValueError(bytes(error_msg))
On 2014/06/13 14:16:28, frankban wrote:
> An explicit conversion seems slightly better here:
> raise ValueError(error_msg.encode('utf-8'))

Done.

https://codereview.appspot.com/108930045/diff/20001/quickstart/platform_suppo...
quickstart/platform_support.py:49: b'juju-quickstart requires brew to be
installed on OS X.'
On 2014/06/13 14:16:27, frankban wrote:
> Missing trailing space to separate the two sentences.

Done.

https://codereview.appspot.com/108930045/diff/20001/quickstart/tests/test_pla...
File quickstart/tests/test_platform_support.py (right):

https://codereview.appspot.com/108930045/diff/20001/quickstart/tests/test_pla...
quickstart/tests/test_platform_support.py:128: class
TestValidatePlatform(unittest.TestCase):
On 2014/06/13 14:16:28, frankban wrote:
> Nice tests, thank you.
> This TestCase could take advantage of helpers.ValueErrorTestsMixin, so that
you
> can avoid some boilerplate, e.g.:
> 
> with self.assert_value_error(expected_error):
>    platform_support.validate_platform(settings.OSX)

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b