Merge lp:~hopem/charms/trusty/neutron-api/make-ml2-configurable into lp:~openstack-charmers-archive/charms/trusty/neutron-api/next

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 97
Proposed branch: lp:~hopem/charms/trusty/neutron-api/make-ml2-configurable
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-api/next
Diff against target: 92 lines (+24/-2)
4 files modified
config.yaml (+5/-0)
hooks/neutron_api_context.py (+11/-0)
templates/icehouse/ml2_conf.ini (+2/-2)
unit_tests/test_neutron_api_context.py (+6/-0)
To merge this branch: bzr merge lp:~hopem/charms/trusty/neutron-api/make-ml2-configurable
Reviewer Review Type Date Requested Status
James Page Approve
Review via email: mp+255870@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 #3223 neutron-api-next for hopem mp255870
    LINT OK: passed

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

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

charm_unit_test #3011 neutron-api-next for hopem mp255870
    UNIT OK: passed

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

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

charm_amulet_test #3040 neutron-api-next for hopem mp255870
    AMULET OK: passed

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

Revision history for this message
James Page (james-page) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2015-03-23 13:17:46 +0000
3+++ config.yaml 2015-04-10 17:44:46 +0000
4@@ -73,6 +73,11 @@
5 gre
6 vxlan
7 .
8+ vlan-ranges:
9+ type: string
10+ default: "physnet1:1000:2000"
11+ description: |
12+ Space-delimited list of network provider vlan id ranges.
13 # Quota configuration settings
14 quota-security-group:
15 default: 10
16
17=== modified file 'hooks/neutron_api_context.py'
18--- hooks/neutron_api_context.py 2015-03-31 07:53:39 +0000
19+++ hooks/neutron_api_context.py 2015-04-10 17:44:46 +0000
20@@ -13,6 +13,9 @@
21 from charmhelpers.contrib.openstack.utils import (
22 os_release,
23 )
24+from charmhelpers.contrib.openstack.neutron import (
25+ parse_vlan_range_mappings,
26+)
27
28
29 def get_l2population():
30@@ -180,6 +183,14 @@
31 continue
32 if ctxt['nova_url']:
33 return ctxt
34+
35+ vlan_ranges = config('vlan-ranges')
36+ vlan_range_mappings = parse_vlan_range_mappings(vlan_ranges)
37+ if vlan_range_mappings:
38+ providers = sorted(vlan_range_mappings.keys())
39+ ctxt['network_providers'] = ','.join(providers)
40+ ctxt['vlan_ranges'] = ','.join(vlan_ranges.split())
41+
42 return ctxt
43
44
45
46=== modified file 'templates/icehouse/ml2_conf.ini'
47--- templates/icehouse/ml2_conf.ini 2014-10-07 08:24:32 +0000
48+++ templates/icehouse/ml2_conf.ini 2015-04-10 17:44:46 +0000
49@@ -15,10 +15,10 @@
50 vni_ranges = 1001:2000
51
52 [ml2_type_vlan]
53-network_vlan_ranges = physnet1:1000:2000
54+network_vlan_ranges = {{ vlan_ranges }}
55
56 [ml2_type_flat]
57-flat_networks = physnet1
58+flat_networks = {{ network_providers }}
59
60 [ovs]
61 enable_tunneling = True
62
63=== modified file 'unit_tests/test_neutron_api_context.py'
64--- unit_tests/test_neutron_api_context.py 2015-03-27 10:59:50 +0000
65+++ unit_tests/test_neutron_api_context.py 2015-04-10 17:44:46 +0000
66@@ -286,6 +286,8 @@
67 'quota_security_group_rule': 100,
68 'quota_subnet': 10,
69 'quota_vip': 10,
70+ 'vlan_ranges': 'physnet1:1000:2000',
71+ 'network_providers': 'physnet1',
72 }
73 napi_ctxt = context.NeutronCCContext()
74 with patch.object(napi_ctxt, '_ensure_packages'):
75@@ -317,6 +319,8 @@
76 'quota_security_group_rule': 100,
77 'quota_subnet': 10,
78 'quota_vip': 10,
79+ 'vlan_ranges': 'physnet1:1000:2000',
80+ 'network_providers': 'physnet1',
81 }
82 napi_ctxt = context.NeutronCCContext()
83 with patch.object(napi_ctxt, '_ensure_packages'):
84@@ -354,6 +358,8 @@
85 'quota_security_group_rule': 100,
86 'quota_subnet': 10,
87 'quota_vip': 10,
88+ 'vlan_ranges': 'physnet1:1000:2000',
89+ 'network_providers': 'physnet1',
90 }
91 napi_ctxt = context.NeutronCCContext()
92 with patch.object(napi_ctxt, '_ensure_packages'):

Subscribers

People subscribed via source and target branches