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

Proposed by Ionut-Madalin Balutoiu
Status: Merged
Merged at revision: 155
Proposed branch: lp:~ionutbalutoiu/charms/trusty/neutron-gateway/next
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-gateway/next
Diff against target: 93 lines (+27/-0)
4 files modified
config.yaml (+6/-0)
hooks/neutron_contexts.py (+5/-0)
templates/havana/dnsmasq.conf (+5/-0)
unit_tests/test_neutron_contexts.py (+11/-0)
To merge this branch: bzr merge lp:~ionutbalutoiu/charms/trusty/neutron-gateway/next
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+276833@code.launchpad.net

Description of the change

Adds config option to provide additional config flags for the neutron dnsmasq.

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #13163 neutron-gateway-next for ionutbalutoiu mp276833
    LINT OK: passed

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

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

charm_unit_test #12315 neutron-gateway-next for ionutbalutoiu mp276833
    UNIT OK: passed

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

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

charm_amulet_test #7769 neutron-gateway-next for ionutbalutoiu mp276833
    AMULET OK: passed

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

154. By Ionut-Madalin Balutoiu

Added config option for the additional dnsmasq flags

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

charm_lint_check #13922 neutron-gateway-next for ionutbalutoiu mp276833
    LINT OK: passed

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

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

charm_unit_test #12979 neutron-gateway-next for ionutbalutoiu mp276833
    UNIT OK: passed

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2015-10-08 12:02:13 +0000
+++ config.yaml 2015-11-17 13:47:09 +0000
@@ -128,6 +128,12 @@
128 within the cloud. This is useful in deployments where its not128 within the cloud. This is useful in deployments where its not
129 possible to increase MTU on switches and physical servers to129 possible to increase MTU on switches and physical servers to
130 accommodate the packet overhead of using GRE tunnels.130 accommodate the packet overhead of using GRE tunnels.
131 dnsmasq-flags:
132 type: string
133 default:
134 description: |
135 Comma-separated list of key=value config flags with the additional
136 dhcp options for neutron dnsmasq.
131 enable-l3-agent:137 enable-l3-agent:
132 type: boolean138 type: boolean
133 default: True139 default: True
134140
=== modified file 'hooks/neutron_contexts.py'
--- hooks/neutron_contexts.py 2015-10-08 19:12:34 +0000
+++ hooks/neutron_contexts.py 2015-11-17 13:47:09 +0000
@@ -13,6 +13,7 @@
13from charmhelpers.contrib.openstack.context import (13from charmhelpers.contrib.openstack.context import (
14 OSContextGenerator,14 OSContextGenerator,
15 NeutronAPIContext,15 NeutronAPIContext,
16 config_flags_parser
16)17)
17from charmhelpers.contrib.openstack.utils import (18from charmhelpers.contrib.openstack.utils import (
18 get_os_codename_install_source19 get_os_codename_install_source
@@ -154,6 +155,10 @@
154 if vlan_ranges:155 if vlan_ranges:
155 ctxt['vlan_ranges'] = ','.join(vlan_ranges.split())156 ctxt['vlan_ranges'] = ','.join(vlan_ranges.split())
156157
158 dnsmasq_flags = config('dnsmasq-flags')
159 if dnsmasq_flags:
160 ctxt['dnsmasq_flags'] = config_flags_parser(dnsmasq_flags)
161
157 net_dev_mtu = api_settings['network_device_mtu']162 net_dev_mtu = api_settings['network_device_mtu']
158 if net_dev_mtu:163 if net_dev_mtu:
159 ctxt['network_device_mtu'] = net_dev_mtu164 ctxt['network_device_mtu'] = net_dev_mtu
160165
=== modified file 'templates/havana/dnsmasq.conf'
--- templates/havana/dnsmasq.conf 2014-03-31 22:23:32 +0000
+++ templates/havana/dnsmasq.conf 2015-11-17 13:47:09 +0000
@@ -1,3 +1,8 @@
1{%- if instance_mtu -%}1{%- if instance_mtu -%}
2dhcp-option=26,{{ instance_mtu }}2dhcp-option=26,{{ instance_mtu }}
3{% endif -%}3{% endif -%}
4{% if dnsmasq_flags -%}
5{% for key, value in dnsmasq_flags.iteritems() -%}
6{{ key }} = {{ value }}
7{% endfor -%}
8{% endif -%}
49
=== modified file 'unit_tests/test_neutron_contexts.py'
--- unit_tests/test_neutron_contexts.py 2015-05-07 09:33:38 +0000
+++ unit_tests/test_neutron_contexts.py 2015-11-17 13:47:09 +0000
@@ -17,6 +17,7 @@
17 'eligible_leader',17 'eligible_leader',
18 'get_os_codename_install_source',18 'get_os_codename_install_source',
19 'unit_get',19 'unit_get',
20 'config_flags_parser'
20]21]
2122
2223
@@ -123,6 +124,8 @@
123 self.test_config.set('debug', False)124 self.test_config.set('debug', False)
124 self.test_config.set('verbose', True)125 self.test_config.set('verbose', True)
125 self.test_config.set('instance-mtu', 1420)126 self.test_config.set('instance-mtu', 1420)
127 self.test_config.set('dnsmasq-flags', 'dhcp-userclass=set:ipxe,iPXE,'
128 'dhcp-match=set:ipxe,175')
126 self.test_config.set('vlan-ranges',129 self.test_config.set('vlan-ranges',
127 'physnet1:1000:2000 physnet2:2001:3000')130 'physnet1:1000:2000 physnet2:2001:3000')
128 self.test_config.set('flat-network-providers', 'physnet3 physnet4')131 self.test_config.set('flat-network-providers', 'physnet3 physnet4')
@@ -131,6 +134,10 @@
131 _runits.return_value = ['neutron-api/0']134 _runits.return_value = ['neutron-api/0']
132 _rget.side_effect = lambda *args, **kwargs: rdata135 _rget.side_effect = lambda *args, **kwargs: rdata
133 self.get_os_codename_install_source.return_value = 'folsom'136 self.get_os_codename_install_source.return_value = 'folsom'
137 self.config_flags_parser.return_value = {
138 'dhcp-userclass': 'set:ipxe,iPXE',
139 'dhcp-match': 'set:ipxe,175'
140 }
134 _host_ip.return_value = '10.5.0.1'141 _host_ip.return_value = '10.5.0.1'
135 _secret.return_value = 'testsecret'142 _secret.return_value = 'testsecret'
136 ctxt = neutron_contexts.NeutronGatewayContext()()143 ctxt = neutron_contexts.NeutronGatewayContext()()
@@ -152,6 +159,10 @@
152 'vlan_ranges': 'physnet1:1000:2000,physnet2:2001:3000',159 'vlan_ranges': 'physnet1:1000:2000,physnet2:2001:3000',
153 'network_device_mtu': 9000,160 'network_device_mtu': 9000,
154 'veth_mtu': 9000,161 'veth_mtu': 9000,
162 'dnsmasq_flags': {
163 'dhcp-userclass': 'set:ipxe,iPXE',
164 'dhcp-match': 'set:ipxe,175'
165 }
155 })166 })
156167
157168

Subscribers

People subscribed via source and target branches