Merge lp:~frankban/juju-quickstart/bundlelib-03 into lp:juju-quickstart

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 144
Proposed branch: lp:~frankban/juju-quickstart/bundlelib-03
Merge into: lp:juju-quickstart
Diff against target: 93 lines (+20/-8)
3 files modified
quickstart/__init__.py (+1/-1)
quickstart/models/bundles.py (+15/-3)
tox.ini (+4/-4)
To merge this branch: bzr merge lp:~frankban/juju-quickstart/bundlelib-03
Reviewer Review Type Date Requested Status
Jay R. Wren (community) Approve
Review via email: mp+278328@code.launchpad.net

Description of the change

Update to use jujubundlelib 0.3.0.

To post a comment you must log in.
Revision history for this message
Jay R. Wren (evarlast) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'quickstart/__init__.py'
--- quickstart/__init__.py 2015-10-27 10:14:10 +0000
+++ quickstart/__init__.py 2015-11-23 14:58:55 +0000
@@ -45,7 +45,7 @@
45Once Juju has been installed, the command can also be run as a juju plugin,45Once Juju has been installed, the command can also be run as a juju plugin,
46without the hyphen ("juju quickstart").46without the hyphen ("juju quickstart").
47"""47"""
48VERSION = (2, 2, 2)48VERSION = (2, 2, 3)
4949
5050
51def get_version():51def get_version():
5252
=== modified file 'quickstart/models/bundles.py'
--- quickstart/models/bundles.py 2015-08-11 09:06:56 +0000
+++ quickstart/models/bundles.py 2015-11-23 14:58:55 +0000
@@ -239,15 +239,14 @@
239 # For this reason, we cannot infer the new bundle identifier from a239 # For this reason, we cannot infer the new bundle identifier from a
240 # charmworld URL: we instead need to try to fetch both references.240 # charmworld URL: we instead need to try to fetch both references.
241 fullname = '{}-{}'.format(basket, name)241 fullname = '{}-{}'.format(basket, name)
242 reference = references.Reference('cs', user, 'bundle', fullname, revision)242 reference = _reference_from_data(user, fullname, revision)
243 try:243 try:
244 data = charmstore.get_bundle_data(reference)244 data = charmstore.get_bundle_data(reference)
245 except charmstore.NotFoundError:245 except charmstore.NotFoundError:
246 # Also try the case in which a single bundle was included in the246 # Also try the case in which a single bundle was included in the
247 # legacy YAML. In this case, validating that the name was included247 # legacy YAML. In this case, validating that the name was included
248 # in the original YAML is also required.248 # in the original YAML is also required.
249 reference = references.Reference(249 reference = _reference_from_data(user, basket, revision)
250 'cs', user, 'bundle', basket, revision)
251 # Validate the bundle name is included in the legacy data.250 # Validate the bundle name is included in the legacy data.
252 _flatten_data(charmstore.get_legacy_bundle_data(reference), name)251 _flatten_data(charmstore.get_legacy_bundle_data(reference), name)
253 # Retrieve the new bundle data corresponding to the shorter reference.252 # Retrieve the new bundle data corresponding to the shorter reference.
@@ -265,6 +264,19 @@
265 return Bundle(data, reference=reference)264 return Bundle(data, reference=reference)
266265
267266
267def _reference_from_data(user, name, revision):
268 """Instantiate a "jujubundlelib.references.Reference" from the given data.
269
270 Provide a backward compatibility layer between jujubundlelib 0.2.1 and
271 0.3.0.
272 """
273 try:
274 # Try old version without channel.
275 return references.Reference('cs', user, 'bundle', name, revision)
276 except TypeError:
277 return references.Reference('cs', user, '', 'bundle', name, revision)
278
279
268def _retrieve_from_url(url):280def _retrieve_from_url(url):
269 """Retrieve bundle YAML content from the given URL.281 """Retrieve bundle YAML content from the given URL.
270282
271283
=== modified file 'tox.ini'
--- tox.ini 2015-11-05 10:46:10 +0000
+++ tox.ini 2015-11-23 14:58:55 +0000
@@ -72,7 +72,7 @@
72 # See https://launchpad.net/~juju/+archive/ubuntu/stable.72 # See https://launchpad.net/~juju/+archive/ubuntu/stable.
73 websocket-client==0.18.073 websocket-client==0.18.0
74 jujuclient==0.50.374 jujuclient==0.50.3
75 jujubundlelib==0.2.175 jujubundlelib==0.3.0
76 urwid==1.2.176 urwid==1.2.1
77 # The distribution PyYAML requirement is used in this case.77 # The distribution PyYAML requirement is used in this case.
7878
@@ -82,7 +82,7 @@
82 # Ubuntu 14.04 (trusty) distro dependencies.82 # Ubuntu 14.04 (trusty) distro dependencies.
83 websocket-client==0.12.083 websocket-client==0.12.0
84 jujuclient==0.17.584 jujuclient==0.17.5
85 jujubundlelib==0.2.085 jujubundlelib==0.3.0
86 PyYAML==3.1086 PyYAML==3.10
87 urwid==1.1.187 urwid==1.1.1
8888
@@ -92,7 +92,7 @@
92 # Ubuntu 15.04 (vivid) distro dependencies.92 # Ubuntu 15.04 (vivid) distro dependencies.
93 websocket-client==0.18.093 websocket-client==0.18.0
94 jujuclient==0.18.594 jujuclient==0.18.5
95 jujubundlelib==0.2.095 jujubundlelib==0.3.0
96 PyYAML==3.1196 PyYAML==3.11
97 urwid==1.2.197 urwid==1.2.1
9898
@@ -102,7 +102,7 @@
102 # Ubuntu 15.10 (wily) distro dependencies.102 # Ubuntu 15.10 (wily) distro dependencies.
103 websocket-client==0.18.0103 websocket-client==0.18.0
104 jujuclient==0.50.1104 jujuclient==0.50.1
105 jujubundlelib==0.2.0105 jujubundlelib==0.3.0
106 PyYAML==3.11106 PyYAML==3.11
107 urwid==1.2.1107 urwid==1.2.1
108108

Subscribers

People subscribed via source and target branches