Merge lp:~james-page/charms/trusty/quantum-gateway/fixup-utopic into lp:~openstack-charmers/charms/trusty/quantum-gateway/next

Proposed by James Page
Status: Merged
Merged at revision: 61
Proposed branch: lp:~james-page/charms/trusty/quantum-gateway/fixup-utopic
Merge into: lp:~openstack-charmers/charms/trusty/quantum-gateway/next
Diff against target: 86 lines (+24/-3)
2 files modified
hooks/quantum_utils.py (+6/-3)
unit_tests/test_quantum_utils.py (+18/-0)
To merge this branch: bzr merge lp:~james-page/charms/trusty/quantum-gateway/fixup-utopic
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+235254@code.launchpad.net

Description of the change

Fixup support on utopic; only use VPN bits for < utopic - so Juno or Icehouse on 14.04 still work.

To post a comment you must log in.
Revision history for this message
Liam Young (gnuoy) wrote :

Approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/quantum_utils.py'
2--- hooks/quantum_utils.py 2014-06-24 13:40:39 +0000
3+++ hooks/quantum_utils.py 2014-09-19 09:23:53 +0000
4@@ -1,7 +1,8 @@
5 from charmhelpers.core.host import (
6 service_running,
7 service_stop,
8- service_restart
9+ service_restart,
10+ lsb_release
11 )
12 from charmhelpers.core.hookenv import (
13 log,
14@@ -112,7 +113,6 @@
15 "nova-api-metadata",
16 "neutron-plugin-metering-agent",
17 "neutron-lbaas-agent",
18- "openswan"
19 ],
20 NVP: [
21 "neutron-dhcp-agent",
22@@ -148,10 +148,13 @@
23 plugin = remap_plugin(config('plugin'))
24 packages = deepcopy(GATEWAY_PKGS[networking_name()][plugin])
25 if (get_os_codename_install_source(config('openstack-origin'))
26- >= 'icehouse' and plugin == 'ovs'):
27+ >= 'icehouse' and plugin == 'ovs'
28+ and lsb_release()['DISTRIB_CODENAME'] < 'utopic'):
29 # NOTE(jamespage) neutron-vpn-agent supercedes l3-agent for icehouse
30+ # but openswan was removed in utopic.
31 packages.remove('neutron-l3-agent')
32 packages.append('neutron-vpn-agent')
33+ packages.append('openswan')
34 return packages
35
36
37
38=== modified file 'unit_tests/test_quantum_utils.py'
39--- unit_tests/test_quantum_utils.py 2014-06-24 13:40:39 +0000
40+++ unit_tests/test_quantum_utils.py 2014-09-19 09:23:53 +0000
41@@ -43,6 +43,7 @@
42 'service_restart',
43 'remap_plugin',
44 'is_relation_made',
45+ 'lsb_release'
46 ]
47
48
49@@ -62,6 +63,7 @@
50 super(TestQuantumUtils, self).setUp(quantum_utils, TO_PATCH)
51 self.networking_name.return_value = 'neutron'
52 self.headers_package.return_value = 'linux-headers-2.6.18'
53+ self._set_distrib_codename('trusty')
54
55 def noop(value):
56 return value
57@@ -71,6 +73,9 @@
58 # Reset cached cache
59 hookenv.cache = {}
60
61+ def _set_distrib_codename(self, newcodename):
62+ self.lsb_release.return_value = {'DISTRIB_CODENAME': newcodename}
63+
64 def test_valid_plugin(self):
65 self.config.return_value = 'ovs'
66 self.assertTrue(quantum_utils.valid_plugin())
67@@ -113,6 +118,19 @@
68 self.assertTrue('neutron-vpn-agent' in quantum_utils.get_packages())
69 self.assertFalse('neutron-l3-agent' in quantum_utils.get_packages())
70
71+ def test_get_packages_ovs_juno_utopic(self):
72+ self.config.return_value = 'ovs'
73+ self.get_os_codename_install_source.return_value = 'juno'
74+ self._set_distrib_codename('utopic')
75+ self.assertFalse('neutron-vpn-agent' in quantum_utils.get_packages())
76+ self.assertTrue('neutron-l3-agent' in quantum_utils.get_packages())
77+
78+ def test_get_packages_ovs_juno_trusty(self):
79+ self.config.return_value = 'ovs'
80+ self.get_os_codename_install_source.return_value = 'juno'
81+ self.assertTrue('neutron-vpn-agent' in quantum_utils.get_packages())
82+ self.assertFalse('neutron-l3-agent' in quantum_utils.get_packages())
83+
84 def test_configure_ovs_starts_service_if_required(self):
85 self.config.return_value = 'ovs'
86 self.service_running.return_value = False

Subscribers

People subscribed via source and target branches