Merge lp:~hopem/charms/trusty/neutron-gateway/lp1500386 into lp:~openstack-charmers-archive/charms/trusty/neutron-gateway/next

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 148
Proposed branch: lp:~hopem/charms/trusty/neutron-gateway/lp1500386
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-gateway/next
Diff against target: 113 lines (+29/-12)
5 files modified
hooks/charmhelpers/contrib/openstack/context.py (+3/-3)
hooks/charmhelpers/contrib/openstack/neutron.py (+3/-3)
hooks/neutron_utils.py (+4/-3)
tests/charmhelpers/contrib/openstack/amulet/utils.py (+1/-1)
unit_tests/test_neutron_utils.py (+18/-2)
To merge this branch: bzr merge lp:~hopem/charms/trusty/neutron-gateway/lp1500386
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+272571@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 #10897 neutron-gateway-next for hopem mp272571
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/10897/

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

charm_unit_test #10114 neutron-gateway-next for hopem mp272571
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/10114/

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

charm_amulet_test #6849 neutron-gateway-next for hopem mp272571
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/6849/

149. By Edward Hope-Morley

sync ch

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

charm_lint_check #11033 neutron-gateway-next for hopem mp272571
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/11033/

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

charm_unit_test #10243 neutron-gateway-next for hopem mp272571
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/10243/

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

charm_amulet_test #6887 neutron-gateway-next for hopem mp272571
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/6887/

Revision history for this message
Liam Young (gnuoy) wrote :

Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/charmhelpers/contrib/openstack/context.py'
--- hooks/charmhelpers/contrib/openstack/context.py 2015-09-25 16:13:05 +0000
+++ hooks/charmhelpers/contrib/openstack/context.py 2015-09-29 20:59:59 +0000
@@ -1364,7 +1364,7 @@
1364 normalized.update({port: port for port in resolved1364 normalized.update({port: port for port in resolved
1365 if port in ports})1365 if port in ports})
1366 if resolved:1366 if resolved:
1367 return {bridge: normalized[port] for port, bridge in1367 return {normalized[port]: bridge for port, bridge in
1368 six.iteritems(portmap) if port in normalized.keys()}1368 six.iteritems(portmap) if port in normalized.keys()}
13691369
1370 return None1370 return None
@@ -1375,8 +1375,8 @@
1375 def __call__(self):1375 def __call__(self):
1376 ctxt = {}1376 ctxt = {}
1377 mappings = super(PhyNICMTUContext, self).__call__()1377 mappings = super(PhyNICMTUContext, self).__call__()
1378 if mappings and mappings.values():1378 if mappings and mappings.keys():
1379 ports = mappings.values()1379 ports = sorted(mappings.keys())
1380 napi_settings = NeutronAPIContext()()1380 napi_settings = NeutronAPIContext()()
1381 mtu = napi_settings.get('network_device_mtu')1381 mtu = napi_settings.get('network_device_mtu')
1382 all_ports = set()1382 all_ports = set()
13831383
=== modified file 'hooks/charmhelpers/contrib/openstack/neutron.py'
--- hooks/charmhelpers/contrib/openstack/neutron.py 2015-09-03 09:43:15 +0000
+++ hooks/charmhelpers/contrib/openstack/neutron.py 2015-09-29 20:59:59 +0000
@@ -310,10 +310,10 @@
310def parse_data_port_mappings(mappings, default_bridge='br-data'):310def parse_data_port_mappings(mappings, default_bridge='br-data'):
311 """Parse data port mappings.311 """Parse data port mappings.
312312
313 Mappings must be a space-delimited list of port:bridge mappings.313 Mappings must be a space-delimited list of bridge:port.
314314
315 Returns dict of the form {port:bridge} where port may be an mac address or315 Returns dict of the form {port:bridge} where ports may be mac addresses or
316 interface name.316 interface names.
317 """317 """
318318
319 # NOTE(dosaboy): we use rvalue for key to allow multiple values to be319 # NOTE(dosaboy): we use rvalue for key to allow multiple values to be
320320
=== modified file 'hooks/neutron_utils.py'
--- hooks/neutron_utils.py 2015-09-28 08:01:40 +0000
+++ hooks/neutron_utils.py 2015-09-29 20:59:59 +0000
@@ -751,11 +751,12 @@
751 bridgemaps = parse_bridge_mappings(config('bridge-mappings'))751 bridgemaps = parse_bridge_mappings(config('bridge-mappings'))
752 for provider, br in bridgemaps.iteritems():752 for provider, br in bridgemaps.iteritems():
753 add_bridge(br)753 add_bridge(br)
754754 if not portmaps:
755 if not portmaps or br not in portmaps:
756 continue755 continue
757756
758 add_bridge_port(br, portmaps[br], promisc=True)757 for port, _br in portmaps.iteritems():
758 if _br == br:
759 add_bridge_port(br, port, promisc=True)
759760
760 # Ensure this runs so that mtu is applied to data-port interfaces if761 # Ensure this runs so that mtu is applied to data-port interfaces if
761 # provided.762 # provided.
762763
=== modified file 'tests/charmhelpers/contrib/openstack/amulet/utils.py'
--- tests/charmhelpers/contrib/openstack/amulet/utils.py 2015-09-28 10:06:18 +0000
+++ tests/charmhelpers/contrib/openstack/amulet/utils.py 2015-09-29 20:59:59 +0000
@@ -752,7 +752,7 @@
752 self.log.debug('SSL is enabled @{}:{} '752 self.log.debug('SSL is enabled @{}:{} '
753 '({})'.format(host, port, unit_name))753 '({})'.format(host, port, unit_name))
754 return True754 return True
755 elif not port and not conf_ssl:755 elif not conf_ssl:
756 self.log.debug('SSL not enabled @{}:{} '756 self.log.debug('SSL not enabled @{}:{} '
757 '({})'.format(host, port, unit_name))757 '({})'.format(host, port, unit_name))
758 return False758 return False
759759
=== modified file 'unit_tests/test_neutron_utils.py'
--- unit_tests/test_neutron_utils.py 2015-09-28 08:01:40 +0000
+++ unit_tests/test_neutron_utils.py 2015-09-29 20:59:59 +0000
@@ -221,9 +221,10 @@
221 call('br-ex'),221 call('br-ex'),
222 call('br-data')222 call('br-data')
223 ])223 ])
224 self.assertTrue(self.add_bridge_port.called)224 calls = [call('br-data', 'eth0', promisc=True)]
225 self.add_bridge_port.assert_has_calls(calls)
225226
226 # Now test with bridge:port format227 # Now test with bridge:port format and bogus bridge
227 self.test_config.set('data-port', 'br-foo:eth0')228 self.test_config.set('data-port', 'br-foo:eth0')
228 self.add_bridge.reset_mock()229 self.add_bridge.reset_mock()
229 self.add_bridge_port.reset_mock()230 self.add_bridge_port.reset_mock()
@@ -236,6 +237,21 @@
236 # Not called since we have a bogus bridge in data-ports237 # Not called since we have a bogus bridge in data-ports
237 self.assertFalse(self.add_bridge_port.called)238 self.assertFalse(self.add_bridge_port.called)
238239
240 # Now test with bridge:port format
241 self.test_config.set('bridge-mappings', 'net1:br1')
242 self.test_config.set('data-port', 'br1:eth0.100 br1:eth0.200')
243 self.add_bridge.reset_mock()
244 self.add_bridge_port.reset_mock()
245 neutron_utils.configure_ovs()
246 self.add_bridge.assert_has_calls([
247 call('br-int'),
248 call('br-ex'),
249 call('br1')
250 ])
251 calls = [call('br1', 'eth0.100', promisc=True),
252 call('br1', 'eth0.200', promisc=True)]
253 self.add_bridge_port.assert_has_calls(calls)
254
239 @patch.object(neutron_utils, 'git_install_requested')255 @patch.object(neutron_utils, 'git_install_requested')
240 def test_do_openstack_upgrade(self, git_requested):256 def test_do_openstack_upgrade(self, git_requested):
241 git_requested.return_value = False257 git_requested.return_value = False

Subscribers

People subscribed via source and target branches