Merge lp:~gnuoy/charms/trusty/nova-cloud-controller/fix-db-migrations into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Liam Young
Status: Merged
Merged at revision: 123
Proposed branch: lp:~gnuoy/charms/trusty/nova-cloud-controller/fix-db-migrations
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 94 lines (+36/-34)
2 files modified
hooks/nova_cc_utils.py (+35/-33)
unit_tests/test_nova_cc_utils.py (+1/-1)
To merge this branch: bzr merge lp:~gnuoy/charms/trusty/nova-cloud-controller/fix-db-migrations
Reviewer Review Type Date Requested Status
James Page Approve
Review via email: mp+239389@code.launchpad.net

Description of the change

If the neutron-api relation was present then this charm was dropping management of neutron which included the neutron config files. Unfortunately those files are needed to run the db migrations. This mp stops the services associated with the neutron files from being managed but reinstates the management of the files themselves.

I have tested by doing a deployment and omitting the nova-cc <-> mysql relation. Then, adding the relation in and checking that a db migration is run correctly and that the neutron-server is restarted on the neutron-api server

To post a comment you must log in.
Revision history for this message
Ryan Beisner (1chb1n) wrote :

UOSCI bot says:
charm_lint_check #742 nova-cloud-controller-next for gnuoy mp239389
    LINT OK: believed to pass, but you should confirm results

LINT Results (max last 4 lines) from
/var/lib/jenkins/workspace/charm_lint_check/make-lint.742:
I: config.yaml: option haproxy-client-timeout has no default value
I: config.yaml: option ssl_cert has no default value
I: config.yaml: option nvp-l3-uuid has no default value
I: config.yaml: option os-internal-network has no default value

Full lint output: http://paste.ubuntu.com/8641966/
Build: http://10.98.191.181:8080/job/charm_lint_check/742/

Revision history for this message
Ryan Beisner (1chb1n) wrote :

UOSCI bot says:
charm_unit_test #550 nova-cloud-controller-next for gnuoy mp239389
    UNIT OK: believed to pass, but you should confirm results

UNIT Results (max last 4 lines) from
/var/lib/jenkins/workspace/charm_unit_test/unit-test.550:
----------------------------------------------------------------------
Ran 96 tests in 9.060s

OK

Full unit output: http://paste.ubuntu.com/8641977/
Build: http://10.98.191.181:8080/job/charm_unit_test/550/

Revision history for this message
Ryan Beisner (1chb1n) wrote :

UOSCI bot says:
charm_amulet_test #295 nova-cloud-controller-next for gnuoy mp239389
    AMULET OK: believed to pass, but you should confirm results

AMULET Results (max last 4 lines) from
/var/lib/jenkins/workspace/charm_amulet_test/make-test.295:
juju-test.conductor DEBUG : Tearing down osci-sv01 juju environment
juju-test.conductor DEBUG : Calling "juju destroy-environment -y osci-sv01"
WARNING cannot delete security group "juju-osci-sv01-0". Used by another environment?
juju-test INFO : Results: 3 passed, 0 failed, 0 errored

Full amulet output: http://paste.ubuntu.com/8642180/
Build: http://10.98.191.181:8080/job/charm_amulet_test/295/

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
=== modified file 'hooks/nova_cc_utils.py'
--- hooks/nova_cc_utils.py 2014-10-22 21:07:15 +0000
+++ hooks/nova_cc_utils.py 2014-10-23 15:10:01 +0000
@@ -232,42 +232,44 @@
232 else:232 else:
233 resource_map.pop(APACHE_24_CONF)233 resource_map.pop(APACHE_24_CONF)
234234
235 resource_map[NOVA_CONF]['contexts'].append(
236 nova_cc_context.NeutronCCContext())
237 # pop out irrelevant resources from the OrderedDict (easier than adding
238 # them late)
239 if net_manager != 'quantum':
240 [resource_map.pop(k) for k in list(resource_map.iterkeys())
241 if 'quantum' in k]
242 if net_manager != 'neutron':
243 [resource_map.pop(k) for k in list(resource_map.iterkeys())
244 if 'neutron' in k]
245 # add neutron plugin requirements. nova-c-c only needs the
246 # neutron-server associated with configs, not the plugin agent.
247 if net_manager in ['quantum', 'neutron']:
248 plugin = neutron_plugin()
249 if plugin:
250 conf = neutron_plugin_attribute(plugin, 'config', net_manager)
251 ctxts = (neutron_plugin_attribute(plugin, 'contexts',
252 net_manager)
253 or [])
254 services = neutron_plugin_attribute(plugin, 'server_services',
255 net_manager)
256 resource_map[conf] = {}
257 resource_map[conf]['services'] = services
258 resource_map[conf]['contexts'] = ctxts
259 resource_map[conf]['contexts'].append(
260 nova_cc_context.NeutronCCContext())
261
262 # update for postgres
263 resource_map[conf]['contexts'].append(
264 nova_cc_context.NeutronPostgresqlDBContext())
265
235 if is_relation_made('neutron-api'):266 if is_relation_made('neutron-api'):
236 [resource_map.pop(k) for k in list(resource_map.iterkeys())267 for k in list(resource_map.iterkeys()):
237 if 'quantum' in k or 'neutron' in k]268 # neutron-api runs neutron services
269 if 'quantum' in k or 'neutron' in k:
270 resource_map[k]['services'] = []
238 resource_map[NOVA_CONF]['contexts'].append(271 resource_map[NOVA_CONF]['contexts'].append(
239 nova_cc_context.NeutronAPIContext())272 nova_cc_context.NeutronAPIContext())
240 else:
241 resource_map[NOVA_CONF]['contexts'].append(
242 nova_cc_context.NeutronCCContext())
243 # pop out irrelevant resources from the OrderedDict (easier than adding
244 # them late)
245 if net_manager != 'quantum':
246 [resource_map.pop(k) for k in list(resource_map.iterkeys())
247 if 'quantum' in k]
248 if net_manager != 'neutron':
249 [resource_map.pop(k) for k in list(resource_map.iterkeys())
250 if 'neutron' in k]
251 # add neutron plugin requirements. nova-c-c only needs the
252 # neutron-server associated with configs, not the plugin agent.
253 if net_manager in ['quantum', 'neutron']:
254 plugin = neutron_plugin()
255 if plugin:
256 conf = neutron_plugin_attribute(plugin, 'config', net_manager)
257 ctxts = (neutron_plugin_attribute(plugin, 'contexts',
258 net_manager)
259 or [])
260 services = neutron_plugin_attribute(plugin, 'server_services',
261 net_manager)
262 resource_map[conf] = {}
263 resource_map[conf]['services'] = services
264 resource_map[conf]['contexts'] = ctxts
265 resource_map[conf]['contexts'].append(
266 nova_cc_context.NeutronCCContext())
267
268 # update for postgres
269 resource_map[conf]['contexts'].append(
270 nova_cc_context.NeutronPostgresqlDBContext())
271273
272 # nova-conductor for releases >= G.274 # nova-conductor for releases >= G.
273 if os_release('nova-common') not in ['essex', 'folsom']:275 if os_release('nova-common') not in ['essex', 'folsom']:
274276
=== modified file 'unit_tests/test_nova_cc_utils.py'
--- unit_tests/test_nova_cc_utils.py 2014-10-10 13:37:30 +0000
+++ unit_tests/test_nova_cc_utils.py 2014-10-23 15:10:01 +0000
@@ -186,7 +186,7 @@
186 '/etc/neutron/neutron.conf',186 '/etc/neutron/neutron.conf',
187 ]187 ]
188 for q_conf in confs:188 for q_conf in confs:
189 self.assertFalse(q_conf in _map.keys())189 self.assertEquals(_map[q_conf]['services'], [])
190190
191 @patch('charmhelpers.contrib.openstack.context.SubordinateConfigContext')191 @patch('charmhelpers.contrib.openstack.context.SubordinateConfigContext')
192 def test_resource_map_vmware(self, subcontext):192 def test_resource_map_vmware(self, subcontext):

Subscribers

People subscribed via source and target branches