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
1=== modified file 'hooks/nova_cc_utils.py'
2--- hooks/nova_cc_utils.py 2014-10-22 21:07:15 +0000
3+++ hooks/nova_cc_utils.py 2014-10-23 15:10:01 +0000
4@@ -232,42 +232,44 @@
5 else:
6 resource_map.pop(APACHE_24_CONF)
7
8+ resource_map[NOVA_CONF]['contexts'].append(
9+ nova_cc_context.NeutronCCContext())
10+ # pop out irrelevant resources from the OrderedDict (easier than adding
11+ # them late)
12+ if net_manager != 'quantum':
13+ [resource_map.pop(k) for k in list(resource_map.iterkeys())
14+ if 'quantum' in k]
15+ if net_manager != 'neutron':
16+ [resource_map.pop(k) for k in list(resource_map.iterkeys())
17+ if 'neutron' in k]
18+ # add neutron plugin requirements. nova-c-c only needs the
19+ # neutron-server associated with configs, not the plugin agent.
20+ if net_manager in ['quantum', 'neutron']:
21+ plugin = neutron_plugin()
22+ if plugin:
23+ conf = neutron_plugin_attribute(plugin, 'config', net_manager)
24+ ctxts = (neutron_plugin_attribute(plugin, 'contexts',
25+ net_manager)
26+ or [])
27+ services = neutron_plugin_attribute(plugin, 'server_services',
28+ net_manager)
29+ resource_map[conf] = {}
30+ resource_map[conf]['services'] = services
31+ resource_map[conf]['contexts'] = ctxts
32+ resource_map[conf]['contexts'].append(
33+ nova_cc_context.NeutronCCContext())
34+
35+ # update for postgres
36+ resource_map[conf]['contexts'].append(
37+ nova_cc_context.NeutronPostgresqlDBContext())
38+
39 if is_relation_made('neutron-api'):
40- [resource_map.pop(k) for k in list(resource_map.iterkeys())
41- if 'quantum' in k or 'neutron' in k]
42+ for k in list(resource_map.iterkeys()):
43+ # neutron-api runs neutron services
44+ if 'quantum' in k or 'neutron' in k:
45+ resource_map[k]['services'] = []
46 resource_map[NOVA_CONF]['contexts'].append(
47 nova_cc_context.NeutronAPIContext())
48- else:
49- resource_map[NOVA_CONF]['contexts'].append(
50- nova_cc_context.NeutronCCContext())
51- # pop out irrelevant resources from the OrderedDict (easier than adding
52- # them late)
53- if net_manager != 'quantum':
54- [resource_map.pop(k) for k in list(resource_map.iterkeys())
55- if 'quantum' in k]
56- if net_manager != 'neutron':
57- [resource_map.pop(k) for k in list(resource_map.iterkeys())
58- if 'neutron' in k]
59- # add neutron plugin requirements. nova-c-c only needs the
60- # neutron-server associated with configs, not the plugin agent.
61- if net_manager in ['quantum', 'neutron']:
62- plugin = neutron_plugin()
63- if plugin:
64- conf = neutron_plugin_attribute(plugin, 'config', net_manager)
65- ctxts = (neutron_plugin_attribute(plugin, 'contexts',
66- net_manager)
67- or [])
68- services = neutron_plugin_attribute(plugin, 'server_services',
69- net_manager)
70- resource_map[conf] = {}
71- resource_map[conf]['services'] = services
72- resource_map[conf]['contexts'] = ctxts
73- resource_map[conf]['contexts'].append(
74- nova_cc_context.NeutronCCContext())
75-
76- # update for postgres
77- resource_map[conf]['contexts'].append(
78- nova_cc_context.NeutronPostgresqlDBContext())
79
80 # nova-conductor for releases >= G.
81 if os_release('nova-common') not in ['essex', 'folsom']:
82
83=== modified file 'unit_tests/test_nova_cc_utils.py'
84--- unit_tests/test_nova_cc_utils.py 2014-10-10 13:37:30 +0000
85+++ unit_tests/test_nova_cc_utils.py 2014-10-23 15:10:01 +0000
86@@ -186,7 +186,7 @@
87 '/etc/neutron/neutron.conf',
88 ]
89 for q_conf in confs:
90- self.assertFalse(q_conf in _map.keys())
91+ self.assertEquals(_map[q_conf]['services'], [])
92
93 @patch('charmhelpers.contrib.openstack.context.SubordinateConfigContext')
94 def test_resource_map_vmware(self, subcontext):

Subscribers

People subscribed via source and target branches