Merge lp:~james-page/charms/trusty/neutron-gateway/mitaka-neutron-changes into lp:~openstack-charmers-archive/charms/trusty/neutron-gateway/next
- Trusty Tahr (14.04)
- mitaka-neutron-changes
- Merge into next
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ryan Beisner (community) | Approve | ||
Review via email: mp+286900@code.launchpad.net |
Commit message
Description of the change
uosci-testing-bot (uosci-testing-bot) wrote : | # |
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #1071 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #471 neutron-
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://
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #478 neutron-
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://
Build: http://
- 170. By James Page
-
Rebase on tox branch
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #1302 neutron-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #1075 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #480 neutron-
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://
Build: http://
- 171. By James Page
-
Disable mitaka changes for now; re-enable once neutron-ovs landed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #1471 neutron-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #1228 neutron-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #526 neutron-
AMULET OK: passed
Ryan Beisner (1chb1n) : | # |
Preview Diff
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 | 102 | "/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini" | 102 | "/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini" |
6 | 103 | NEUTRON_ML2_PLUGIN_CONF = \ | 103 | NEUTRON_ML2_PLUGIN_CONF = \ |
7 | 104 | "/etc/neutron/plugins/ml2/ml2_conf.ini" | 104 | "/etc/neutron/plugins/ml2/ml2_conf.ini" |
8 | 105 | NEUTRON_OVS_AGENT_CONF = \ | ||
9 | 106 | "/etc/neutron/plugins/ml2/openvswitch_agent.ini" | ||
10 | 105 | NEUTRON_NVP_PLUGIN_CONF = \ | 107 | NEUTRON_NVP_PLUGIN_CONF = \ |
11 | 106 | "/etc/neutron/plugins/nicira/nvp.ini" | 108 | "/etc/neutron/plugins/nicira/nvp.ini" |
12 | 107 | NEUTRON_NSX_PLUGIN_CONF = \ | 109 | NEUTRON_NSX_PLUGIN_CONF = \ |
13 | @@ -279,6 +281,10 @@ | |||
14 | 279 | # Switch out to actual metering agent package | 281 | # Switch out to actual metering agent package |
15 | 280 | packages.remove('neutron-plugin-metering-agent') | 282 | packages.remove('neutron-plugin-metering-agent') |
16 | 281 | packages.append('neutron-metering-agent') | 283 | packages.append('neutron-metering-agent') |
17 | 284 | if source >= 'mitaka': | ||
18 | 285 | # Switch out to actual ovs agent package | ||
19 | 286 | packages.remove('neutron-plugin-openvswitch-agent') | ||
20 | 287 | packages.append('neutron-openvswitch-agent') | ||
21 | 282 | packages.extend(determine_l3ha_packages()) | 288 | packages.extend(determine_l3ha_packages()) |
22 | 283 | 289 | ||
23 | 284 | if git_install_requested(): | 290 | if git_install_requested(): |
24 | @@ -452,6 +458,10 @@ | |||
25 | 452 | 'hook_contexts': [NeutronGatewayContext()], | 458 | 'hook_contexts': [NeutronGatewayContext()], |
26 | 453 | 'services': ['neutron-plugin-openvswitch-agent'] | 459 | 'services': ['neutron-plugin-openvswitch-agent'] |
27 | 454 | }, | 460 | }, |
28 | 461 | NEUTRON_OVS_AGENT_CONF: { | ||
29 | 462 | 'hook_contexts': [NeutronGatewayContext()], | ||
30 | 463 | 'services': ['neutron-openvswitch-agent'] | ||
31 | 464 | }, | ||
32 | 455 | EXT_PORT_CONF: { | 465 | EXT_PORT_CONF: { |
33 | 456 | 'hook_contexts': [ExternalPortContext()], | 466 | 'hook_contexts': [ExternalPortContext()], |
34 | 457 | 'services': ['ext-port'] | 467 | 'services': ['ext-port'] |
35 | @@ -567,7 +577,12 @@ | |||
36 | 567 | }, | 577 | }, |
37 | 568 | } | 578 | } |
38 | 569 | 579 | ||
40 | 570 | SERVICE_RENAMES = {} | 580 | SERVICE_RENAMES = { |
41 | 581 | 'mitaka': { | ||
42 | 582 | 'neutron-plugin-openvswitch-agent': 'neutron-openvswitch-agent', | ||
43 | 583 | 'neutron-plugin-metering-agent': 'neutron-metering-agent', | ||
44 | 584 | } | ||
45 | 585 | } | ||
46 | 571 | 586 | ||
47 | 572 | 587 | ||
48 | 573 | def remap_service(service_name): | 588 | def remap_service(service_name): |
49 | @@ -599,10 +614,16 @@ | |||
50 | 599 | config_files = deepcopy(CONFIG_FILES) | 614 | config_files = deepcopy(CONFIG_FILES) |
51 | 600 | if plugin == 'ovs': | 615 | if plugin == 'ovs': |
52 | 601 | # NOTE: deal with switch to ML2 plugin for >= icehouse | 616 | # NOTE: deal with switch to ML2 plugin for >= icehouse |
54 | 602 | drop_config = [NEUTRON_ML2_PLUGIN_CONF] | 617 | drop_config = [NEUTRON_ML2_PLUGIN_CONF, |
55 | 618 | NEUTRON_OVS_AGENT_CONF] | ||
56 | 603 | if release >= 'icehouse': | 619 | if release >= 'icehouse': |
57 | 604 | # ovs -> ml2 | 620 | # ovs -> ml2 |
59 | 605 | drop_config = [NEUTRON_OVS_PLUGIN_CONF] | 621 | drop_config = [NEUTRON_OVS_PLUGIN_CONF, |
60 | 622 | NEUTRON_OVS_AGENT_CONF] | ||
61 | 623 | if release >= 'mitaka': | ||
62 | 624 | # ml2 -> ovs_agent | ||
63 | 625 | drop_config = [NEUTRON_OVS_PLUGIN_CONF, | ||
64 | 626 | NEUTRON_ML2_PLUGIN_CONF] | ||
65 | 606 | 627 | ||
66 | 607 | for _config in drop_config: | 628 | for _config in drop_config: |
67 | 608 | if _config in config_files[name][plugin]: | 629 | if _config in config_files[name][plugin]: |
68 | @@ -637,11 +658,14 @@ | |||
69 | 637 | 658 | ||
70 | 638 | 659 | ||
71 | 639 | def stop_services(): | 660 | def stop_services(): |
72 | 661 | release = get_os_codename_install_source(config('openstack-origin')) | ||
73 | 662 | plugin = remap_plugin(config('plugin')) | ||
74 | 640 | name = networking_name() | 663 | name = networking_name() |
75 | 664 | config_files = resolve_config_files(name, plugin, release) | ||
76 | 641 | svcs = set() | 665 | svcs = set() |
78 | 642 | for ctxt in CONFIG_FILES[name][config('plugin')].itervalues(): | 666 | for ctxt in config_files[name][config('plugin')].itervalues(): |
79 | 643 | for svc in ctxt['services']: | 667 | for svc in ctxt['services']: |
81 | 644 | svcs.add(svc) | 668 | svcs.add(remap_service(svc)) |
82 | 645 | for svc in svcs: | 669 | for svc in svcs: |
83 | 646 | service_stop(svc) | 670 | service_stop(svc) |
84 | 647 | 671 | ||
85 | 648 | 672 | ||
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 | 1 | # mitaka | ||
91 | 2 | ############################################################################### | ||
92 | 3 | # [ WARNING ] | ||
93 | 4 | # Configuration file maintained by Juju. Local changes may be overwritten. | ||
94 | 5 | ############################################################################### | ||
95 | 6 | [ovs] | ||
96 | 7 | enable_tunneling = True | ||
97 | 8 | local_ip = {{ local_ip }} | ||
98 | 9 | bridge_mappings = {{ bridge_mappings }} | ||
99 | 10 | |||
100 | 11 | [agent] | ||
101 | 12 | tunnel_types = {{ overlay_network_type }} | ||
102 | 13 | l2_population = {{ l2_population }} | ||
103 | 14 | enable_distributed_routing = {{ enable_dvr }} | ||
104 | 15 | {% if veth_mtu -%} | ||
105 | 16 | veth_mtu = {{ veth_mtu }} | ||
106 | 17 | {% endif %} | ||
107 | 18 | |||
108 | 19 | [securitygroup] | ||
109 | 20 | firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver | ||
110 | 0 | 21 | ||
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 | 185 | 185 | ||
117 | 186 | if self._get_openstack_release() <= self.trusty_juno: | 186 | if self._get_openstack_release() <= self.trusty_juno: |
118 | 187 | neutron_services.append('neutron-vpn-agent') | 187 | neutron_services.append('neutron-vpn-agent') |
119 | 188 | if self._get_openstack_release() >= self.trusty_mitaka: | ||
120 | 189 | # neutron-plugin-openvswitch-agent -> neutron-openvswitch-agent | ||
121 | 190 | neutron_services.remove('neutron-plugin-openvswitch-agent') | ||
122 | 191 | neutron_services.append('neutron-openvswitch-agent') | ||
123 | 188 | 192 | ||
124 | 189 | nova_cc_services = ['nova-api-ec2', | 193 | nova_cc_services = ['nova-api-ec2', |
125 | 190 | 'nova-api-os-compute', | 194 | 'nova-api-os-compute', |
126 | 191 | 195 | ||
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 | 170 | self.assertTrue('python-pymysql' in packages) | 170 | self.assertTrue('python-pymysql' in packages) |
132 | 171 | 171 | ||
133 | 172 | @patch.object(neutron_utils, 'git_install_requested') | 172 | @patch.object(neutron_utils, 'git_install_requested') |
134 | 173 | def test_get_packages_ovs_mitaka(self, git_requested): | ||
135 | 174 | git_requested.return_value = False | ||
136 | 175 | self.config.return_value = 'ovs' | ||
137 | 176 | self.get_os_codename_install_source.return_value = 'mitaka' | ||
138 | 177 | packages = neutron_utils.get_packages() | ||
139 | 178 | self.assertTrue('neutron-metering-agent' in packages) | ||
140 | 179 | self.assertFalse('neutron-plugin-metering-agent' in packages) | ||
141 | 180 | self.assertTrue('neutron-openvswitch-agent' in packages) | ||
142 | 181 | self.assertFalse('neutron-plugin-openvswitch-agent' in packages) | ||
143 | 182 | self.assertFalse('python-mysqldb' in packages) | ||
144 | 183 | self.assertTrue('python-pymysql' in packages) | ||
145 | 184 | |||
146 | 185 | @patch.object(neutron_utils, 'git_install_requested') | ||
147 | 173 | def test_get_packages_l3ha(self, git_requested): | 186 | def test_get_packages_l3ha(self, git_requested): |
148 | 174 | git_requested.return_value = False | 187 | git_requested.return_value = False |
149 | 175 | self.config.return_value = 'ovs' | 188 | self.config.return_value = 'ovs' |
150 | @@ -355,6 +368,41 @@ | |||
151 | 355 | 368 | ||
152 | 356 | self.assertDictEqual(neutron_utils.restart_map(), ex_map) | 369 | self.assertDictEqual(neutron_utils.restart_map(), ex_map) |
153 | 357 | 370 | ||
154 | 371 | def test_restart_map_ovs_mitaka(self): | ||
155 | 372 | self.config.return_value = 'ovs' | ||
156 | 373 | self.get_os_codename_install_source.return_value = 'mitaka' | ||
157 | 374 | ex_map = { | ||
158 | 375 | neutron_utils.NEUTRON_CONF: ['neutron-l3-agent', | ||
159 | 376 | 'neutron-dhcp-agent', | ||
160 | 377 | 'neutron-metadata-agent', | ||
161 | 378 | 'neutron-openvswitch-agent', | ||
162 | 379 | 'neutron-metering-agent', | ||
163 | 380 | 'neutron-lbaas-agent', | ||
164 | 381 | 'neutron-plugin-vpn-agent', | ||
165 | 382 | 'neutron-vpn-agent'], | ||
166 | 383 | neutron_utils.NEUTRON_DNSMASQ_CONF: ['neutron-dhcp-agent'], | ||
167 | 384 | neutron_utils.NEUTRON_LBAAS_AGENT_CONF: | ||
168 | 385 | ['neutron-lbaas-agent'], | ||
169 | 386 | neutron_utils.NEUTRON_OVS_AGENT_CONF: | ||
170 | 387 | ['neutron-openvswitch-agent'], | ||
171 | 388 | neutron_utils.NEUTRON_METADATA_AGENT_CONF: | ||
172 | 389 | ['neutron-metadata-agent'], | ||
173 | 390 | neutron_utils.NEUTRON_VPNAAS_AGENT_CONF: [ | ||
174 | 391 | 'neutron-plugin-vpn-agent', | ||
175 | 392 | 'neutron-vpn-agent'], | ||
176 | 393 | neutron_utils.NEUTRON_L3_AGENT_CONF: ['neutron-l3-agent', | ||
177 | 394 | 'neutron-vpn-agent'], | ||
178 | 395 | neutron_utils.NEUTRON_DHCP_AGENT_CONF: ['neutron-dhcp-agent'], | ||
179 | 396 | neutron_utils.NEUTRON_FWAAS_CONF: ['neutron-l3-agent', | ||
180 | 397 | 'neutron-vpn-agent'], | ||
181 | 398 | neutron_utils.NEUTRON_METERING_AGENT_CONF: | ||
182 | 399 | ['neutron-metering-agent'], | ||
183 | 400 | neutron_utils.NOVA_CONF: ['nova-api-metadata'], | ||
184 | 401 | neutron_utils.EXT_PORT_CONF: ['ext-port'], | ||
185 | 402 | neutron_utils.PHY_NIC_MTU_CONF: ['os-charm-phy-nic-mtu'], | ||
186 | 403 | } | ||
187 | 404 | self.assertEqual(ex_map, neutron_utils.restart_map()) | ||
188 | 405 | |||
189 | 358 | def test_restart_map_ovs_odl(self): | 406 | def test_restart_map_ovs_odl(self): |
190 | 359 | self.config.return_value = 'ovs-odl' | 407 | self.config.return_value = 'ovs-odl' |
191 | 360 | self.get_os_codename_install_source.return_value = 'icehouse' | 408 | self.get_os_codename_install_source.return_value = 'icehouse' |
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/