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
1=== modified file 'config.yaml'
2--- config.yaml 2015-10-08 12:02:13 +0000
3+++ config.yaml 2015-11-17 13:47:09 +0000
4@@ -128,6 +128,12 @@
5 within the cloud. This is useful in deployments where its not
6 possible to increase MTU on switches and physical servers to
7 accommodate the packet overhead of using GRE tunnels.
8+ dnsmasq-flags:
9+ type: string
10+ default:
11+ description: |
12+ Comma-separated list of key=value config flags with the additional
13+ dhcp options for neutron dnsmasq.
14 enable-l3-agent:
15 type: boolean
16 default: True
17
18=== modified file 'hooks/neutron_contexts.py'
19--- hooks/neutron_contexts.py 2015-10-08 19:12:34 +0000
20+++ hooks/neutron_contexts.py 2015-11-17 13:47:09 +0000
21@@ -13,6 +13,7 @@
22 from charmhelpers.contrib.openstack.context import (
23 OSContextGenerator,
24 NeutronAPIContext,
25+ config_flags_parser
26 )
27 from charmhelpers.contrib.openstack.utils import (
28 get_os_codename_install_source
29@@ -154,6 +155,10 @@
30 if vlan_ranges:
31 ctxt['vlan_ranges'] = ','.join(vlan_ranges.split())
32
33+ dnsmasq_flags = config('dnsmasq-flags')
34+ if dnsmasq_flags:
35+ ctxt['dnsmasq_flags'] = config_flags_parser(dnsmasq_flags)
36+
37 net_dev_mtu = api_settings['network_device_mtu']
38 if net_dev_mtu:
39 ctxt['network_device_mtu'] = net_dev_mtu
40
41=== modified file 'templates/havana/dnsmasq.conf'
42--- templates/havana/dnsmasq.conf 2014-03-31 22:23:32 +0000
43+++ templates/havana/dnsmasq.conf 2015-11-17 13:47:09 +0000
44@@ -1,3 +1,8 @@
45 {%- if instance_mtu -%}
46 dhcp-option=26,{{ instance_mtu }}
47 {% endif -%}
48+{% if dnsmasq_flags -%}
49+{% for key, value in dnsmasq_flags.iteritems() -%}
50+{{ key }} = {{ value }}
51+{% endfor -%}
52+{% endif -%}
53
54=== modified file 'unit_tests/test_neutron_contexts.py'
55--- unit_tests/test_neutron_contexts.py 2015-05-07 09:33:38 +0000
56+++ unit_tests/test_neutron_contexts.py 2015-11-17 13:47:09 +0000
57@@ -17,6 +17,7 @@
58 'eligible_leader',
59 'get_os_codename_install_source',
60 'unit_get',
61+ 'config_flags_parser'
62 ]
63
64
65@@ -123,6 +124,8 @@
66 self.test_config.set('debug', False)
67 self.test_config.set('verbose', True)
68 self.test_config.set('instance-mtu', 1420)
69+ self.test_config.set('dnsmasq-flags', 'dhcp-userclass=set:ipxe,iPXE,'
70+ 'dhcp-match=set:ipxe,175')
71 self.test_config.set('vlan-ranges',
72 'physnet1:1000:2000 physnet2:2001:3000')
73 self.test_config.set('flat-network-providers', 'physnet3 physnet4')
74@@ -131,6 +134,10 @@
75 _runits.return_value = ['neutron-api/0']
76 _rget.side_effect = lambda *args, **kwargs: rdata
77 self.get_os_codename_install_source.return_value = 'folsom'
78+ self.config_flags_parser.return_value = {
79+ 'dhcp-userclass': 'set:ipxe,iPXE',
80+ 'dhcp-match': 'set:ipxe,175'
81+ }
82 _host_ip.return_value = '10.5.0.1'
83 _secret.return_value = 'testsecret'
84 ctxt = neutron_contexts.NeutronGatewayContext()()
85@@ -152,6 +159,10 @@
86 'vlan_ranges': 'physnet1:1000:2000,physnet2:2001:3000',
87 'network_device_mtu': 9000,
88 'veth_mtu': 9000,
89+ 'dnsmasq_flags': {
90+ 'dhcp-userclass': 'set:ipxe,iPXE',
91+ 'dhcp-match': 'set:ipxe,175'
92+ }
93 })
94
95

Subscribers

People subscribed via source and target branches