Merge lp:~makyo/juju-quickstart/no-gui-in-bundle into lp:juju-quickstart
Proposed by
Madison Scott-Clary
Status: | Merged |
---|---|
Merged at revision: | 12 |
Proposed branch: | lp:~makyo/juju-quickstart/no-gui-in-bundle |
Merge into: | lp:juju-quickstart |
Diff against target: |
37 lines (+16/-2) 2 files modified
quickstart/tests/test_utils.py (+11/-0) quickstart/utils.py (+5/-2) |
To merge this branch: | bzr merge lp:~makyo/juju-quickstart/no-gui-in-bundle |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email:
|
Description of the change
Error on juju-gui in the bundle services
Quickstart should fail if there is an instance of juju-gui in the services, because that will lead to a name conflict when deploying the bundle.
To test: `make check`
To QA: `.venv/bin/python juju-quickstart https:/
To post a comment you must log in.
Reviewers: mp+194907_ code.launchpad. net,
Message:
Please take a look.
Description:
Error on juju-gui in the bundle services
Quickstart should fail if there is an instance of juju-gui in the
services, because that will lead to a name conflict when deploying the
bundle.
To test: `make check`
To QA: `.venv/bin/python juju-quickstart /gist.github. com/makyo/ 7435270/ raw/6f0d5ff910d d1a82b97c717091 5a196381b2b146/ bundle. yaml`
https:/
should fail with a message explaining that juju-gui should be removed
from the bundle; other bundles will still succeed.
https:/ /code.launchpad .net/~makyo/ juju-quickstart /no-gui- in-bundle/ +merge/ 194907
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/25340043/
Affected files (+18, -2 lines): tests/test_ utils.py
A [revision details]
M quickstart/
M quickstart/utils.py
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision:
<email address hidden>
+New revision: <email address hidden>
Index: quickstart/utils.py utils.py' .format( bundle_ name) '.format( bundle_ name))
=== modified file 'quickstart/
--- quickstart/utils.py 2013-11-06 10:16:42 +0000
+++ quickstart/utils.py 2013-11-12 17:45:33 +0000
@@ -151,8 +151,11 @@
if not bundle_services:
msg = 'bundle {} does not include any services'
raise ValueError(msg)
- # XXX 2013-10-21 frankban:
- # Handle the case when the GUI is included in the bundle.
+ if 'juju-gui' in bundle_services:
+ raise ValueError('bundle {} contains an instance of juju-gui. '
+ 'quickstart will install the latest version of
the '
+ 'Juju GUI automatically, please remove juju-gui
from '
+ 'the bundle.
return bundle_name, bundle_services
Index: quickstart/ tests/test_ utils.py tests/test_ utils.py' tests/test_ utils.py 2013-11-06 14:55:30 +0000 tests/test_ utils.py 2013-11-12 17:45:33 +0000 value_error( expected) :
utils.parse_ bundle( contents)
=== modified file 'quickstart/
--- quickstart/
+++ quickstart/
@@ -233,6 +233,17 @@
with self.assert_
+ def test_yaml_ gui_in_ services( self): value_error( expected) : bundle( contents) no_name( self):
+ # A ValueError is raised if the bundle contains juju-gui.
+ contents = yaml.safe_dump({
+ 'mybundle': {'services': {'juju-gui': {}}},
+ })
+ expected = 'bundle mybundle contains an instance of juju-gui. ' \
+ 'quickstart will install the latest version of the Juju GUI ' \
+ 'automatically, please remove juju-gui from the bundle.'
+ with self.assert_
+ utils.parse_
+
def test_success_
# The function succeeds when an implicit bundle name is used.
contents = yaml.safe_dump({