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
1=== modified file 'hooks/charmhelpers/contrib/openstack/context.py'
2--- hooks/charmhelpers/contrib/openstack/context.py 2015-09-25 16:13:05 +0000
3+++ hooks/charmhelpers/contrib/openstack/context.py 2015-09-29 20:59:59 +0000
4@@ -1364,7 +1364,7 @@
5 normalized.update({port: port for port in resolved
6 if port in ports})
7 if resolved:
8- return {bridge: normalized[port] for port, bridge in
9+ return {normalized[port]: bridge for port, bridge in
10 six.iteritems(portmap) if port in normalized.keys()}
11
12 return None
13@@ -1375,8 +1375,8 @@
14 def __call__(self):
15 ctxt = {}
16 mappings = super(PhyNICMTUContext, self).__call__()
17- if mappings and mappings.values():
18- ports = mappings.values()
19+ if mappings and mappings.keys():
20+ ports = sorted(mappings.keys())
21 napi_settings = NeutronAPIContext()()
22 mtu = napi_settings.get('network_device_mtu')
23 all_ports = set()
24
25=== modified file 'hooks/charmhelpers/contrib/openstack/neutron.py'
26--- hooks/charmhelpers/contrib/openstack/neutron.py 2015-09-03 09:43:15 +0000
27+++ hooks/charmhelpers/contrib/openstack/neutron.py 2015-09-29 20:59:59 +0000
28@@ -310,10 +310,10 @@
29 def parse_data_port_mappings(mappings, default_bridge='br-data'):
30 """Parse data port mappings.
31
32- Mappings must be a space-delimited list of port:bridge mappings.
33+ Mappings must be a space-delimited list of bridge:port.
34
35- Returns dict of the form {port:bridge} where port may be an mac address or
36- interface name.
37+ Returns dict of the form {port:bridge} where ports may be mac addresses or
38+ interface names.
39 """
40
41 # NOTE(dosaboy): we use rvalue for key to allow multiple values to be
42
43=== modified file 'hooks/neutron_utils.py'
44--- hooks/neutron_utils.py 2015-09-28 08:01:40 +0000
45+++ hooks/neutron_utils.py 2015-09-29 20:59:59 +0000
46@@ -751,11 +751,12 @@
47 bridgemaps = parse_bridge_mappings(config('bridge-mappings'))
48 for provider, br in bridgemaps.iteritems():
49 add_bridge(br)
50-
51- if not portmaps or br not in portmaps:
52+ if not portmaps:
53 continue
54
55- add_bridge_port(br, portmaps[br], promisc=True)
56+ for port, _br in portmaps.iteritems():
57+ if _br == br:
58+ add_bridge_port(br, port, promisc=True)
59
60 # Ensure this runs so that mtu is applied to data-port interfaces if
61 # provided.
62
63=== modified file 'tests/charmhelpers/contrib/openstack/amulet/utils.py'
64--- tests/charmhelpers/contrib/openstack/amulet/utils.py 2015-09-28 10:06:18 +0000
65+++ tests/charmhelpers/contrib/openstack/amulet/utils.py 2015-09-29 20:59:59 +0000
66@@ -752,7 +752,7 @@
67 self.log.debug('SSL is enabled @{}:{} '
68 '({})'.format(host, port, unit_name))
69 return True
70- elif not port and not conf_ssl:
71+ elif not conf_ssl:
72 self.log.debug('SSL not enabled @{}:{} '
73 '({})'.format(host, port, unit_name))
74 return False
75
76=== modified file 'unit_tests/test_neutron_utils.py'
77--- unit_tests/test_neutron_utils.py 2015-09-28 08:01:40 +0000
78+++ unit_tests/test_neutron_utils.py 2015-09-29 20:59:59 +0000
79@@ -221,9 +221,10 @@
80 call('br-ex'),
81 call('br-data')
82 ])
83- self.assertTrue(self.add_bridge_port.called)
84+ calls = [call('br-data', 'eth0', promisc=True)]
85+ self.add_bridge_port.assert_has_calls(calls)
86
87- # Now test with bridge:port format
88+ # Now test with bridge:port format and bogus bridge
89 self.test_config.set('data-port', 'br-foo:eth0')
90 self.add_bridge.reset_mock()
91 self.add_bridge_port.reset_mock()
92@@ -236,6 +237,21 @@
93 # Not called since we have a bogus bridge in data-ports
94 self.assertFalse(self.add_bridge_port.called)
95
96+ # Now test with bridge:port format
97+ self.test_config.set('bridge-mappings', 'net1:br1')
98+ self.test_config.set('data-port', 'br1:eth0.100 br1:eth0.200')
99+ self.add_bridge.reset_mock()
100+ self.add_bridge_port.reset_mock()
101+ neutron_utils.configure_ovs()
102+ self.add_bridge.assert_has_calls([
103+ call('br-int'),
104+ call('br-ex'),
105+ call('br1')
106+ ])
107+ calls = [call('br1', 'eth0.100', promisc=True),
108+ call('br1', 'eth0.200', promisc=True)]
109+ self.add_bridge_port.assert_has_calls(calls)
110+
111 @patch.object(neutron_utils, 'git_install_requested')
112 def test_do_openstack_upgrade(self, git_requested):
113 git_requested.return_value = False

Subscribers

People subscribed via source and target branches