Merge lp:~james-page/charms/trusty/neutron-gateway/mitaka-neutron-changes into lp:~openstack-charmers-archive/charms/trusty/neutron-gateway/next

Proposed by James Page
Status: Merged
Merged at revision: 167
Proposed branch: lp:~james-page/charms/trusty/neutron-gateway/mitaka-neutron-changes
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-gateway/next
Diff against target: 191 lines (+101/-5)
4 files modified
hooks/neutron_utils.py (+29/-5)
templates/mitaka/openvswitch_agent.ini (+20/-0)
tests/basic_deployment.py (+4/-0)
unit_tests/test_neutron_utils.py (+48/-0)
To merge this branch: bzr merge lp:~james-page/charms/trusty/neutron-gateway/mitaka-neutron-changes
Reviewer Review Type Date Requested Status
Ryan Beisner (community) Approve
Review via email: mp+286900@code.launchpad.net
To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #1293 neutron-gateway-next for james-page mp286900
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/1293/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #1071 neutron-gateway-next for james-page mp286900
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/1071/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #471 neutron-gateway-next for james-page mp286900
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/15180758/
Build: http://10.245.162.36:8080/job/charm_amulet_test/471/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #478 neutron-gateway-next for james-page mp286900
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/15181962/
Build: http://10.245.162.36:8080/job/charm_amulet_test/478/

170. By James Page on 2016-02-23

Rebase on tox branch

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #1302 neutron-gateway-next for james-page mp286900
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/1302/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #1075 neutron-gateway-next for james-page mp286900
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/1075/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #480 neutron-gateway-next for james-page mp286900
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/15182551/
Build: http://10.245.162.36:8080/job/charm_amulet_test/480/

171. By James Page on 2016-02-25

Disable mitaka changes for now; re-enable once neutron-ovs landed

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #1471 neutron-gateway-next for james-page mp286900
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/1471/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #1228 neutron-gateway-next for james-page mp286900
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/1228/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #526 neutron-gateway-next for james-page mp286900
    AMULET OK: passed

Build: http://10.245.162.36:8080/job/charm_amulet_test/526/

Revision history for this message
Ryan Beisner (1chb1n) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/neutron_utils.py'
2--- hooks/neutron_utils.py 2016-02-23 18:01:39 +0000
3+++ hooks/neutron_utils.py 2016-02-25 14:18:55 +0000
4@@ -102,6 +102,8 @@
5 "/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini"
6 NEUTRON_ML2_PLUGIN_CONF = \
7 "/etc/neutron/plugins/ml2/ml2_conf.ini"
8+NEUTRON_OVS_AGENT_CONF = \
9+ "/etc/neutron/plugins/ml2/openvswitch_agent.ini"
10 NEUTRON_NVP_PLUGIN_CONF = \
11 "/etc/neutron/plugins/nicira/nvp.ini"
12 NEUTRON_NSX_PLUGIN_CONF = \
13@@ -279,6 +281,10 @@
14 # Switch out to actual metering agent package
15 packages.remove('neutron-plugin-metering-agent')
16 packages.append('neutron-metering-agent')
17+ if source >= 'mitaka':
18+ # Switch out to actual ovs agent package
19+ packages.remove('neutron-plugin-openvswitch-agent')
20+ packages.append('neutron-openvswitch-agent')
21 packages.extend(determine_l3ha_packages())
22
23 if git_install_requested():
24@@ -452,6 +458,10 @@
25 'hook_contexts': [NeutronGatewayContext()],
26 'services': ['neutron-plugin-openvswitch-agent']
27 },
28+ NEUTRON_OVS_AGENT_CONF: {
29+ 'hook_contexts': [NeutronGatewayContext()],
30+ 'services': ['neutron-openvswitch-agent']
31+ },
32 EXT_PORT_CONF: {
33 'hook_contexts': [ExternalPortContext()],
34 'services': ['ext-port']
35@@ -567,7 +577,12 @@
36 },
37 }
38
39-SERVICE_RENAMES = {}
40+SERVICE_RENAMES = {
41+ 'mitaka': {
42+ 'neutron-plugin-openvswitch-agent': 'neutron-openvswitch-agent',
43+ 'neutron-plugin-metering-agent': 'neutron-metering-agent',
44+ }
45+}
46
47
48 def remap_service(service_name):
49@@ -599,10 +614,16 @@
50 config_files = deepcopy(CONFIG_FILES)
51 if plugin == 'ovs':
52 # NOTE: deal with switch to ML2 plugin for >= icehouse
53- drop_config = [NEUTRON_ML2_PLUGIN_CONF]
54+ drop_config = [NEUTRON_ML2_PLUGIN_CONF,
55+ NEUTRON_OVS_AGENT_CONF]
56 if release >= 'icehouse':
57 # ovs -> ml2
58- drop_config = [NEUTRON_OVS_PLUGIN_CONF]
59+ drop_config = [NEUTRON_OVS_PLUGIN_CONF,
60+ NEUTRON_OVS_AGENT_CONF]
61+ if release >= 'mitaka':
62+ # ml2 -> ovs_agent
63+ drop_config = [NEUTRON_OVS_PLUGIN_CONF,
64+ NEUTRON_ML2_PLUGIN_CONF]
65
66 for _config in drop_config:
67 if _config in config_files[name][plugin]:
68@@ -637,11 +658,14 @@
69
70
71 def stop_services():
72+ release = get_os_codename_install_source(config('openstack-origin'))
73+ plugin = remap_plugin(config('plugin'))
74 name = networking_name()
75+ config_files = resolve_config_files(name, plugin, release)
76 svcs = set()
77- for ctxt in CONFIG_FILES[name][config('plugin')].itervalues():
78+ for ctxt in config_files[name][config('plugin')].itervalues():
79 for svc in ctxt['services']:
80- svcs.add(svc)
81+ svcs.add(remap_service(svc))
82 for svc in svcs:
83 service_stop(svc)
84
85
86=== added file 'templates/mitaka/openvswitch_agent.ini'
87--- templates/mitaka/openvswitch_agent.ini 1970-01-01 00:00:00 +0000
88+++ templates/mitaka/openvswitch_agent.ini 2016-02-25 14:18:55 +0000
89@@ -0,0 +1,20 @@
90+# mitaka
91+###############################################################################
92+# [ WARNING ]
93+# Configuration file maintained by Juju. Local changes may be overwritten.
94+###############################################################################
95+[ovs]
96+enable_tunneling = True
97+local_ip = {{ local_ip }}
98+bridge_mappings = {{ bridge_mappings }}
99+
100+[agent]
101+tunnel_types = {{ overlay_network_type }}
102+l2_population = {{ l2_population }}
103+enable_distributed_routing = {{ enable_dvr }}
104+{% if veth_mtu -%}
105+veth_mtu = {{ veth_mtu }}
106+{% endif %}
107+
108+[securitygroup]
109+firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
110
111=== modified file 'tests/019-basic-trusty-mitaka' (properties changed: +x to -x)
112=== modified file 'tests/basic_deployment.py'
113--- tests/basic_deployment.py 2016-02-17 11:43:27 +0000
114+++ tests/basic_deployment.py 2016-02-25 14:18:55 +0000
115@@ -185,6 +185,10 @@
116
117 if self._get_openstack_release() <= self.trusty_juno:
118 neutron_services.append('neutron-vpn-agent')
119+ if self._get_openstack_release() >= self.trusty_mitaka:
120+ # neutron-plugin-openvswitch-agent -> neutron-openvswitch-agent
121+ neutron_services.remove('neutron-plugin-openvswitch-agent')
122+ neutron_services.append('neutron-openvswitch-agent')
123
124 nova_cc_services = ['nova-api-ec2',
125 'nova-api-os-compute',
126
127=== modified file 'unit_tests/test_neutron_utils.py'
128--- unit_tests/test_neutron_utils.py 2016-02-23 18:01:39 +0000
129+++ unit_tests/test_neutron_utils.py 2016-02-25 14:18:55 +0000
130@@ -170,6 +170,19 @@
131 self.assertTrue('python-pymysql' in packages)
132
133 @patch.object(neutron_utils, 'git_install_requested')
134+ def test_get_packages_ovs_mitaka(self, git_requested):
135+ git_requested.return_value = False
136+ self.config.return_value = 'ovs'
137+ self.get_os_codename_install_source.return_value = 'mitaka'
138+ packages = neutron_utils.get_packages()
139+ self.assertTrue('neutron-metering-agent' in packages)
140+ self.assertFalse('neutron-plugin-metering-agent' in packages)
141+ self.assertTrue('neutron-openvswitch-agent' in packages)
142+ self.assertFalse('neutron-plugin-openvswitch-agent' in packages)
143+ self.assertFalse('python-mysqldb' in packages)
144+ self.assertTrue('python-pymysql' in packages)
145+
146+ @patch.object(neutron_utils, 'git_install_requested')
147 def test_get_packages_l3ha(self, git_requested):
148 git_requested.return_value = False
149 self.config.return_value = 'ovs'
150@@ -355,6 +368,41 @@
151
152 self.assertDictEqual(neutron_utils.restart_map(), ex_map)
153
154+ def test_restart_map_ovs_mitaka(self):
155+ self.config.return_value = 'ovs'
156+ self.get_os_codename_install_source.return_value = 'mitaka'
157+ ex_map = {
158+ neutron_utils.NEUTRON_CONF: ['neutron-l3-agent',
159+ 'neutron-dhcp-agent',
160+ 'neutron-metadata-agent',
161+ 'neutron-openvswitch-agent',
162+ 'neutron-metering-agent',
163+ 'neutron-lbaas-agent',
164+ 'neutron-plugin-vpn-agent',
165+ 'neutron-vpn-agent'],
166+ neutron_utils.NEUTRON_DNSMASQ_CONF: ['neutron-dhcp-agent'],
167+ neutron_utils.NEUTRON_LBAAS_AGENT_CONF:
168+ ['neutron-lbaas-agent'],
169+ neutron_utils.NEUTRON_OVS_AGENT_CONF:
170+ ['neutron-openvswitch-agent'],
171+ neutron_utils.NEUTRON_METADATA_AGENT_CONF:
172+ ['neutron-metadata-agent'],
173+ neutron_utils.NEUTRON_VPNAAS_AGENT_CONF: [
174+ 'neutron-plugin-vpn-agent',
175+ 'neutron-vpn-agent'],
176+ neutron_utils.NEUTRON_L3_AGENT_CONF: ['neutron-l3-agent',
177+ 'neutron-vpn-agent'],
178+ neutron_utils.NEUTRON_DHCP_AGENT_CONF: ['neutron-dhcp-agent'],
179+ neutron_utils.NEUTRON_FWAAS_CONF: ['neutron-l3-agent',
180+ 'neutron-vpn-agent'],
181+ neutron_utils.NEUTRON_METERING_AGENT_CONF:
182+ ['neutron-metering-agent'],
183+ neutron_utils.NOVA_CONF: ['nova-api-metadata'],
184+ neutron_utils.EXT_PORT_CONF: ['ext-port'],
185+ neutron_utils.PHY_NIC_MTU_CONF: ['os-charm-phy-nic-mtu'],
186+ }
187+ self.assertEqual(ex_map, neutron_utils.restart_map())
188+
189 def test_restart_map_ovs_odl(self):
190 self.config.return_value = 'ovs-odl'
191 self.get_os_codename_install_source.return_value = 'icehouse'

Subscribers

People subscribed via source and target branches