Affected files (+27, -4 lines):
A [revision details]
M quickstart/__init__.py
M quickstart/models/bundles.py
M quickstart/tests/functional/test_functional.py
M quickstart/tests/models/test_bundles.py
Index: quickstart/__init__.py
=== modified file 'quickstart/__init__.py'
--- quickstart/__init__.py 2015-05-11 10:55:51 +0000
+++ quickstart/__init__.py 2015-05-13 08:27:30 +0000
@@ -45,7 +45,7 @@
Once Juju has been installed, the command can also be run as a juju plugin,
without the hyphen ("juju quickstart").
"""
-VERSION = (2, 1, 0)
+VERSION = (2, 1, 1)
def test_bundle_deployment(self):
# The application can be used to deploy bundles.
- retcode, output, error = run_quickstart(
- self.env_name, 'mediawiki-single')
+ self._check_bundle('mediawiki-single/7')
+
+ def test_user_owned_bundle_deployment(self):
+ # The application can be used to deploy user owned bundles.
+ # The kubernetes bundle also includes subordinate services not
+ # including the "num_units" field.
+ self._check_bundle('u/kubernetes/kubernetes-cluster/3')
+
+ def _check_bundle(self, bundle_name):
+ """Ensure the given bundle name can be properly deployed."""
+ retcode, output, error = run_quickstart(self.env_name, bundle_name) self.assertEqual(0, retcode) self.assertIn('bundle deployment request accepted', output) self.assertEqual('', error)
Reviewers: mp+258972_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix key error: num_units not defined in services.
https:/ /code.launchpad .net/~frankban/ juju-quickstart /fix-num- units/+ merge/258972
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/235490043/
Affected files (+27, -4 lines): __init_ _.py models/ bundles. py tests/functiona l/test_ functional. py tests/models/ test_bundles. py
A [revision details]
M quickstart/
M quickstart/
M quickstart/
M quickstart/
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/ __init_ _.py __init_ _.py' __init_ _.py 2015-05-11 10:55:51 +0000 __init_ _.py 2015-05-13 08:27:30 +0000
=== modified file 'quickstart/
--- quickstart/
+++ quickstart/
@@ -45,7 +45,7 @@
Once Juju has been installed, the command can also be run as a juju plugin,
without the hyphen ("juju quickstart").
"""
-VERSION = (2, 1, 0)
+VERSION = (2, 1, 1)
def get_version():
Index: quickstart/ models/ bundles. py models/ bundles. py' models/ bundles. py 2015-04-24 13:31:28 +0000 models/ bundles. py 2015-05-13 08:31:51 +0000 'services' ] OrderedDict( ) services. keys()) : service_ name] = services[ service_ name][' num_units' ] service_ name] = services[ service_ name].get( 'num_units' ,
=== modified file 'quickstart/
--- quickstart/
+++ quickstart/
@@ -113,7 +113,7 @@
services = self.data[
result = collections.
for service_name in sorted(
- result[
+ result[
0)
return result
Index: quickstart/ tests/functiona l/test_ functional. py tests/functiona l/test_ functional. py' tests/functiona l/test_ functional. py 2015-02-26 19:12:17 +0000 tests/functiona l/test_ functional. py 2015-05-13 08:31:51 +0000
=== modified file 'quickstart/
--- quickstart/
+++ quickstart/
@@ -166,8 +166,17 @@
def test_bundle_ deployment( self): bundle( 'mediawiki- single/ 7') owned_bundle_ deployment( self): bundle( 'u/kubernetes/ kubernetes- cluster/ 3') self.env_ name, bundle_name)
self. assertEqual( 0, retcode)
self. assertIn( 'bundle deployment request accepted', output)
self. assertEqual( '', error)
# The application can be used to deploy bundles.
- retcode, output, error = run_quickstart(
- self.env_name, 'mediawiki-single')
+ self._check_
+
+ def test_user_
+ # The application can be used to deploy user owned bundles.
+ # The kubernetes bundle also includes subordinate services not
+ # including the "num_units" field.
+ self._check_
+
+ def _check_bundle(self, bundle_name):
+ """Ensure the given bundle name can be properly deployed."""
+ retcode, output, error = run_quickstart(
Index: quickstart/ tests/models/ test_bundles. py tests/models/ test_bundles. py' tests/models/ test_bundles. py 2015-04-28 15:25:14 +0000 tests/models/ test_bundles. py 2015-05-13 08:26:57 +0000
[('mysql' , 0), ('wordpress', 1)])
self. assertEqual( expected_ services, self.bundle. services( ))
=== modified file 'quickstart/
--- quickstart/
+++ quickstart/
@@ -121,6 +121,18 @@
+ def test_services_ subordinate_ units(self) : logger- 42'}, OrderedDict( l(expected_ services, bundle.services())
+ # The number of units for a subordinate service is zero.
+ bundle = bundles.Bundle({
+ 'services': {
+ 'logger': {'charm': 'cs:trusty/
+ 'django': {'charm': 'django', 'num_units': 2},
+ },
+ })
+ expected_services = collections.
+ [('django', 2), ('logger', 0)])
+ self.assertEqua
+
class TestFromSource(
helpers. BundleFileTests Mixin, helpers. UrlReadTestsMix in,