Merge lp:~corey.bryant/charm-helpers/upgrade-charm into lp:charm-helpers

Proposed by Corey Bryant on 2015-07-21
Status: Merged
Merged at revision: 411
Proposed branch: lp:~corey.bryant/charm-helpers/upgrade-charm
Merge into: lp:charm-helpers
Diff against target: 27 lines (+3/-3)
2 files modified
charmhelpers/contrib/openstack/templating.py (+2/-2)
tests/contrib/openstack/test_openstack_utils.py (+1/-1)
To merge this branch: bzr merge lp:~corey.bryant/charm-helpers/upgrade-charm
Reviewer Review Type Date Requested Status
James Page 2015-07-21 Approve on 2015-07-23
Review via email: mp+265450@code.launchpad.net
To post a comment you must log in.
Corey Bryant (corey.bryant) wrote :

When attempting to switch from the EOL quantum-gateway charm to the neutron-gateway charm with 'juju upgrade-charm --switch cs:trusty/neutron-gateway quantum-gateway' I hit the following traceback. This patch fixes it.

http://paste.ubuntu.com/11916483/

408. By Corey Bryant on 2015-07-22

Install python-jinja2 during imports, if necessary.

James Page (james-page) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/openstack/templating.py'
2--- charmhelpers/contrib/openstack/templating.py 2015-01-22 06:06:03 +0000
3+++ charmhelpers/contrib/openstack/templating.py 2015-07-22 01:22:09 +0000
4@@ -29,8 +29,8 @@
5 try:
6 from jinja2 import FileSystemLoader, ChoiceLoader, Environment, exceptions
7 except ImportError:
8- # python-jinja2 may not be installed yet, or we're running unittests.
9- FileSystemLoader = ChoiceLoader = Environment = exceptions = None
10+ apt_install('python-jinja2', fatal=True)
11+ from jinja2 import FileSystemLoader, ChoiceLoader, Environment, exceptions
12
13
14 class OSConfigException(Exception):
15
16=== modified file 'tests/contrib/openstack/test_openstack_utils.py'
17--- tests/contrib/openstack/test_openstack_utils.py 2015-07-14 18:12:04 +0000
18+++ tests/contrib/openstack/test_openstack_utils.py 2015-07-22 01:22:09 +0000
19@@ -490,7 +490,7 @@
20 _open.assert_called_with(expected_f, 'wb')
21 _mkdir.assert_called_with(os.path.dirname(expected_f))
22 _file.__enter__().write.assert_has_calls(
23- list(call(line) for line in scriptrc))
24+ list(call(line) for line in scriptrc), any_order=True)
25
26 @patch.object(openstack, 'lsb_release')
27 @patch.object(openstack, 'get_os_version_package')

Subscribers

People subscribed via source and target branches