Merge lp:~james-page/charms/trusty/neutron-api/liberty into lp:~openstack-charmers-archive/charms/trusty/neutron-api/next

Proposed by James Page on 2015-09-16
Status: Merged
Merged at revision: 141
Proposed branch: lp:~james-page/charms/trusty/neutron-api/liberty
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-api/next
Diff against target: 275 lines (+168/-10)
6 files modified
hooks/neutron_api_utils.py (+18/-1)
templates/liberty/neutron.conf (+104/-0)
templates/liberty/neutron_lbaas.conf (+19/-0)
templates/liberty/neutron_vpnaas.conf (+7/-0)
unit_tests/test_neutron_api_hooks.py (+4/-6)
unit_tests/test_neutron_api_utils.py (+16/-3)
To merge this branch: bzr merge lp:~james-page/charms/trusty/neutron-api/liberty
Reviewer Review Type Date Requested Status
Liam Young 2015-09-16 Approve on 2015-09-16
Review via email: mp+271247@code.launchpad.net

This proposal supersedes a proposal from 2015-09-03.

To post a comment you must log in.
uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_lint_check #9297 neutron-api-next for james-page mp270022
    LINT OK: passed

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

uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_unit_test #8596 neutron-api-next for james-page mp270022
    UNIT OK: passed

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

uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_amulet_test #6212 neutron-api-next for james-page mp270022
    AMULET OK: passed

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

charm_lint_check #10122 neutron-api-next for james-page mp271247
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
make: *** [lint] Error 1
ERROR:root:Make target returned non-zero.

Full lint test output: http://paste.ubuntu.com/12425345/
Build: http://10.245.162.77:8080/job/charm_lint_check/10122/

charm_unit_test #9285 neutron-api-next for james-page mp271247
    UNIT OK: passed

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

143. By James Page on 2015-09-16

Fixup lint

144. By James Page on 2015-09-16

Fixup more lint

Liam Young (gnuoy) wrote :

LGTM

review: Approve

charm_amulet_test #6460 neutron-api-next for james-page mp271247
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/12425536/
Build: http://10.245.162.77:8080/job/charm_amulet_test/6460/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/neutron_api_utils.py'
2--- hooks/neutron_api_utils.py 2015-09-04 11:03:14 +0000
3+++ hooks/neutron_api_utils.py 2015-09-16 09:21:08 +0000
4@@ -114,6 +114,8 @@
5 NEUTRON_CONF_DIR = "/etc/neutron"
6
7 NEUTRON_CONF = '%s/neutron.conf' % NEUTRON_CONF_DIR
8+NEUTRON_LBAAS_CONF = '%s/neutron_lbaas.conf' % NEUTRON_CONF_DIR
9+NEUTRON_VPNAAS_CONF = '%s/neutron_vpnaas.conf' % NEUTRON_CONF_DIR
10 HAPROXY_CONF = '/etc/haproxy/haproxy.cfg'
11 APACHE_CONF = '/etc/apache2/sites-available/openstack_https_frontend'
12 APACHE_24_CONF = '/etc/apache2/sites-available/openstack_https_frontend.conf'
13@@ -158,6 +160,17 @@
14 }),
15 ])
16
17+LIBERTY_RESOURCE_MAP = OrderedDict([
18+ (NEUTRON_LBAAS_CONF, {
19+ 'services': ['neutron-server'],
20+ 'contexts': [],
21+ }),
22+ (NEUTRON_VPNAAS_CONF, {
23+ 'services': ['neutron-server'],
24+ 'contexts': [],
25+ }),
26+])
27+
28
29 def api_port(service):
30 return API_PORTS[service]
31@@ -238,12 +251,16 @@
32 return list(set(ports))
33
34
35-def resource_map():
36+def resource_map(release=None):
37 '''
38 Dynamically generate a map of resources that will be managed for a single
39 hook execution.
40 '''
41+ release = release or os_release('neutron-common')
42+
43 resource_map = deepcopy(BASE_RESOURCE_MAP)
44+ if release >= 'liberty':
45+ resource_map.update(LIBERTY_RESOURCE_MAP)
46
47 if os.path.exists('/etc/apache2/conf-available'):
48 resource_map.pop(APACHE_CONF)
49
50=== added directory 'templates/liberty'
51=== added file 'templates/liberty/neutron.conf'
52--- templates/liberty/neutron.conf 1970-01-01 00:00:00 +0000
53+++ templates/liberty/neutron.conf 2015-09-16 09:21:08 +0000
54@@ -0,0 +1,104 @@
55+# liberty
56+###############################################################################
57+# [ WARNING ]
58+# Configuration file maintained by Juju. Local changes may be overwritten.
59+# Restart trigger {{ restart_trigger }}
60+###############################################################################
61+[DEFAULT]
62+verbose = {{ verbose }}
63+debug = {{ debug }}
64+use_syslog = {{ use_syslog }}
65+state_path = /var/lib/neutron
66+bind_host = {{ bind_host }}
67+auth_strategy = keystone
68+notification_driver = neutron.openstack.common.notifier.rpc_notifier
69+api_workers = {{ workers }}
70+rpc_workers = {{ workers }}
71+
72+router_distributed = {{ enable_dvr }}
73+
74+l3_ha = {{ l3_ha }}
75+{% if l3_ha -%}
76+max_l3_agents_per_router = {{ max_l3_agents_per_router }}
77+min_l3_agents_per_router = {{ min_l3_agents_per_router }}
78+{% endif -%}
79+
80+{% if neutron_bind_port -%}
81+bind_port = {{ neutron_bind_port }}
82+{% else -%}
83+bind_port = 9696
84+{% endif -%}
85+
86+{% if core_plugin -%}
87+core_plugin = {{ core_plugin }}
88+{% if service_plugins -%}
89+service_plugins = {{ service_plugins }}
90+{% else -%}
91+{% if neutron_plugin in ['ovs', 'ml2', 'Calico'] -%}
92+service_plugins = router,firewall,lbaas,vpnaas,metering
93+{% endif -%}
94+{% endif -%}
95+{% endif -%}
96+
97+{% if neutron_security_groups -%}
98+allow_overlapping_ips = True
99+{% if neutron_plugin == 'Calico' -%}
100+neutron_firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
101+{% else -%}
102+neutron_firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
103+{% endif -%}
104+{% endif -%}
105+
106+{% if neutron_plugin == 'Calico' -%}
107+dhcp_agents_per_network = 1000
108+{% endif -%}
109+
110+notify_nova_on_port_status_changes = True
111+notify_nova_on_port_data_changes = True
112+nova_url = {{ nova_url }}
113+nova_region_name = {{ region }}
114+{% if auth_host -%}
115+nova_admin_username = {{ admin_user }}
116+nova_admin_tenant_id = {{ admin_tenant_id }}
117+nova_admin_password = {{ admin_password }}
118+nova_admin_auth_url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}/v2.0
119+{% endif -%}
120+
121+{% if sections and 'DEFAULT' in sections -%}
122+{% for key, value in sections['DEFAULT'] -%}
123+{{ key }} = {{ value }}
124+{% endfor -%}
125+{% endif %}
126+
127+{% include "section-zeromq" %}
128+
129+[quotas]
130+quota_driver = neutron.db.quota_db.DbQuotaDriver
131+{% if neutron_security_groups -%}
132+quota_items = network,subnet,port,security_group,security_group_rule
133+quota_security_group = {{ quota_security_group }}
134+quota_security_group_rule = {{ quota_security_group_rule }}
135+{% else -%}
136+quota_items = network,subnet,port
137+{% endif -%}
138+quota_network = {{ quota_network }}
139+quota_subnet = {{ quota_subnet }}
140+quota_port = {{ quota_port }}
141+quota_vip = {{ quota_vip }}
142+quota_pool = {{ quota_pool }}
143+quota_member = {{ quota_member }}
144+quota_health_monitors = {{ quota_health_monitors }}
145+quota_router = {{ quota_router }}
146+quota_floatingip = {{ quota_floatingip }}
147+
148+[agent]
149+root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
150+
151+{% include "section-keystone-authtoken" %}
152+
153+{% include "parts/section-database" %}
154+
155+{% include "section-rabbitmq-oslo" %}
156+
157+[oslo_concurrency]
158+lock_path = $state_path/lock
159
160=== added file 'templates/liberty/neutron_lbaas.conf'
161--- templates/liberty/neutron_lbaas.conf 1970-01-01 00:00:00 +0000
162+++ templates/liberty/neutron_lbaas.conf 2015-09-16 09:21:08 +0000
163@@ -0,0 +1,19 @@
164+# liberty
165+###############################################################################
166+# [ WARNING ]
167+# Configuration file maintained by Juju. Local changes may be overwritten.
168+###############################################################################
169+# [service_auth]
170+# auth_url = http://127.0.0.1:5000/v2.0
171+# admin_tenant_name = %SERVICE_TENANT_NAME%
172+# admin_user = %SERVICE_USER%
173+# admin_password = %SERVICE_PASSWORD%
174+# admin_user_domain = %SERVICE_USER_DOMAIN%
175+# admin_project_domain = %SERVICE_PROJECT_DOMAIN%
176+# region = %REGION%
177+# service_name = lbaas
178+# auth_version = 2
179+
180+[service_providers]
181+service_provider=LOADBALANCER:Haproxy:neutron_lbaas.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
182+# service_provider=LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
183\ No newline at end of file
184
185=== added file 'templates/liberty/neutron_vpnaas.conf'
186--- templates/liberty/neutron_vpnaas.conf 1970-01-01 00:00:00 +0000
187+++ templates/liberty/neutron_vpnaas.conf 2015-09-16 09:21:08 +0000
188@@ -0,0 +1,7 @@
189+# liberty
190+###############################################################################
191+# [ WARNING ]
192+# Configuration file maintained by Juju. Local changes may be overwritten.
193+###############################################################################
194+[service_providers]
195+service_provider=VPN:openswan:neutron_vpnaas.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
196\ No newline at end of file
197
198=== modified file 'unit_tests/test_neutron_api_hooks.py'
199--- unit_tests/test_neutron_api_hooks.py 2015-08-21 07:33:43 +0000
200+++ unit_tests/test_neutron_api_hooks.py 2015-09-16 09:21:08 +0000
201@@ -702,9 +702,8 @@
202 self.relation_ids.side_effect = self._fake_relids
203 _id_rel_joined = self.patch('identity_joined')
204 hooks.configure_https()
205- calls = [call('a2dissite', 'openstack_https_frontend'),
206- call('service', 'apache2', 'reload')]
207- self.check_call.assert_called_has_calls(calls)
208+ self.check_call.assert_called_with(['a2ensite',
209+ 'openstack_https_frontend'])
210 self.assertTrue(_id_rel_joined.called)
211
212 def test_configure_https_nohttps(self):
213@@ -712,9 +711,8 @@
214 self.relation_ids.side_effect = self._fake_relids
215 _id_rel_joined = self.patch('identity_joined')
216 hooks.configure_https()
217- calls = [call('a2dissite', 'openstack_https_frontend'),
218- call('service', 'apache2', 'reload')]
219- self.check_call.assert_called_has_calls(calls)
220+ self.check_call.assert_called_with(['a2dissite',
221+ 'openstack_https_frontend'])
222 self.assertTrue(_id_rel_joined.called)
223
224 def test_conditional_neutron_migration_icehouse(self):
225
226=== modified file 'unit_tests/test_neutron_api_utils.py'
227--- unit_tests/test_neutron_api_utils.py 2015-09-04 11:03:14 +0000
228+++ unit_tests/test_neutron_api_utils.py 2015-09-16 09:21:08 +0000
229@@ -134,6 +134,19 @@
230
231 @patch.object(nutils, 'manage_plugin')
232 @patch('os.path.exists')
233+ def test_resource_map_liberty(self, _path_exists, _manage_plugin):
234+ _path_exists.return_value = False
235+ _manage_plugin.return_value = True
236+ self.os_release.return_value = 'liberty'
237+ _map = nutils.resource_map()
238+ confs = [nutils.NEUTRON_CONF, nutils.NEUTRON_DEFAULT,
239+ nutils.APACHE_CONF, nutils.NEUTRON_LBAAS_CONF,
240+ nutils.NEUTRON_VPNAAS_CONF]
241+ [self.assertIn(q_conf, _map.keys()) for q_conf in confs]
242+ self.assertTrue(nutils.APACHE_24_CONF not in _map.keys())
243+
244+ @patch.object(nutils, 'manage_plugin')
245+ @patch('os.path.exists')
246 def test_resource_map_apache24(self, _path_exists, _manage_plugin):
247 _path_exists.return_value = True
248 _manage_plugin.return_value = True
249@@ -232,7 +245,7 @@
250 configs = MagicMock()
251 nutils.do_openstack_upgrade(configs)
252 self.os_release.assert_called_with('neutron-common')
253- self.log.assert_called()
254+ self.assertTrue(self.log.called)
255 self.configure_installation_source.assert_called_with(
256 'cloud:trusty-juno'
257 )
258@@ -271,7 +284,7 @@
259 configs = MagicMock()
260 nutils.do_openstack_upgrade(configs)
261 self.os_release.assert_called_with('neutron-common')
262- self.log.assert_called()
263+ self.assertTrue(self.log.called)
264 self.configure_installation_source.assert_called_with(
265 'cloud:trusty-kilo'
266 )
267@@ -311,7 +324,7 @@
268 configs = MagicMock()
269 nutils.do_openstack_upgrade(configs)
270 self.os_release.assert_called_with('neutron-common')
271- self.log.assert_called()
272+ self.assertTrue(self.log.called)
273 self.configure_installation_source.assert_called_with(
274 'cloud:trusty-kilo'
275 )

Subscribers

People subscribed via source and target branches