Merge lp:~hopem/charms/trusty/nova-cloud-controller/nova-alchemy-flags into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 137
Proposed branch: lp:~hopem/charms/trusty/nova-cloud-controller/nova-alchemy-flags
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 175 lines (+63/-17)
5 files modified
config.yaml (+12/-6)
hooks/nova_cc_utils.py (+3/-0)
templates/icehouse/nova.conf (+3/-3)
templates/parts/database-v2 (+12/-0)
tests/basic_deployment.py (+33/-8)
To merge this branch: bzr merge lp:~hopem/charms/trusty/nova-cloud-controller/nova-alchemy-flags
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+245451@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Edward Hope-Morley (hopem) wrote :

Also changed 'sql_connection' to 'connection' and moved it all into [database] section since that has been the convention since at least Icehouse and is required for other db options.

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

charm_lint_check #579 nova-cloud-controller-next for hopem mp245451
    LINT OK: passed

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

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

charm_unit_test #608 nova-cloud-controller-next for hopem mp245451
    UNIT OK: passed

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

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

charm_amulet_test #734 nova-cloud-controller-next for hopem mp245451
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
  ERROR subprocess encountered error code 1
  make: *** [test] Error 1

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

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

charm_lint_check #580 nova-cloud-controller-next for hopem mp245451
    LINT OK: passed

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

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

charm_unit_test #609 nova-cloud-controller-next for hopem mp245451
    UNIT OK: passed

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

136. By Edward Hope-Morley

fixed amulet test error and lint issue in tests/basic_deployment.py

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

charm_lint_check #581 nova-cloud-controller-next for hopem mp245451
    LINT OK: passed

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

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

charm_unit_test #610 nova-cloud-controller-next for hopem mp245451
    UNIT OK: passed

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

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

charm_amulet_test #768 nova-cloud-controller-next for hopem mp245451
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
  ERROR subprocess encountered error code 1
  make: *** [test] Error 1

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

137. By Edward Hope-Morley

fix amulet

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

charm_lint_check #717 nova-cloud-controller-next for hopem mp245451
    LINT OK: passed

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

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

charm_unit_test #746 nova-cloud-controller-next for hopem mp245451
    UNIT OK: passed

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

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

charm_amulet_test #902 nova-cloud-controller-next for hopem mp245451
    AMULET OK: passed

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

Revision history for this message
Liam Young (gnuoy) wrote :

Approve

review: Approve

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 2014-10-30 03:30:36 +0000
3+++ config.yaml 2015-01-13 11:55:06 +0000
4@@ -30,6 +30,12 @@
5 default: nova
6 type: string
7 description: Database name
8+ nova-alchemy-flags:
9+ type: string
10+ default:
11+ description: |
12+ Comma-separated list of key=value sqlalchemy related config flags to be
13+ set in nova.conf [database] section.
14 neutron-database-user:
15 default: neutron
16 type: string
17@@ -38,6 +44,12 @@
18 default: neutron
19 type: string
20 description: Database name for Neutron (if enabled)
21+ neutron-alchemy-flags:
22+ type: string
23+ default:
24+ description: |
25+ Comma-separated list of key=value sqlalchemy related config flags to be
26+ set in neutron.conf [database] section.
27 network-manager:
28 default: FlatDHCPManager
29 type: string
30@@ -139,12 +151,6 @@
31 type: string
32 default:
33 description: SSL key to use with certificate specified as ssl_cert.
34- neutron-alchemy-flags:
35- type: string
36- default:
37- description: |
38- Comma separated list of key=value sqlalchemy related config flags to be
39- set in plugin ini file.
40 ssl_ca:
41 type: string
42 default:
43
44=== modified file 'hooks/nova_cc_utils.py'
45--- hooks/nova_cc_utils.py 2014-12-19 10:25:03 +0000
46+++ hooks/nova_cc_utils.py 2015-01-13 11:55:06 +0000
47@@ -110,6 +110,9 @@
48 'contexts': [context.AMQPContext(ssl_dir=NOVA_CONF_DIR),
49 context.SharedDBContext(
50 relation_prefix='nova', ssl_dir=NOVA_CONF_DIR),
51+ context.OSConfigFlagContext(
52+ charm_flag='nova-alchemy-flags',
53+ template_flag='nova_alchemy_flags'),
54 nova_cc_context.NovaPostgresqlDBContext(),
55 context.ImageServiceContext(),
56 context.OSConfigFlagContext(),
57
58=== modified file 'templates/icehouse/nova.conf'
59--- templates/icehouse/nova.conf 2014-12-16 14:08:58 +0000
60+++ templates/icehouse/nova.conf 2015-01-13 11:55:06 +0000
61@@ -46,8 +46,6 @@
62 keystone_ec2_url = {{ keystone_ec2_url }}
63 {% endif -%}
64
65-{% include "parts/database" %}
66-
67 {% include "parts/rabbitmq" %}
68
69 {% if glance_api_servers -%}
70@@ -134,7 +132,9 @@
71 {% for key, value in sections['DEFAULT'] -%}
72 {{ key }} = {{ value }}
73 {% endfor -%}
74-{% endif -%}
75+{% endif %}
76+
77+{% include "parts/database-v2" %}
78
79 {% if auth_host -%}
80 [keystone_authtoken]
81
82=== added file 'templates/parts/database-v2'
83--- templates/parts/database-v2 1970-01-01 00:00:00 +0000
84+++ templates/parts/database-v2 2015-01-13 11:55:06 +0000
85@@ -0,0 +1,12 @@
86+[database]
87+{% if database_host -%}
88+connection = {{ database_type }}://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}{% if database_ssl_ca %}?ssl_ca={{ database_ssl_ca }}{% if database_ssl_cert %}&ssl_cert={{ database_ssl_cert }}&ssl_key={{ database_ssl_key }}{% endif %}{% endif %}
89+{% endif -%}
90+{% if not nova_alchemy_flags or 'max_pool_size' not in nova_alchemy_flags.iterkeys() -%}
91+max_pool_size = {{ workers }}
92+{% endif -%}
93+{% if nova_alchemy_flags -%}
94+{% for key, value in nova_alchemy_flags.iteritems() -%}
95+{{ key }} = {{ value }}
96+{% endfor -%}
97+{% endif -%}
98
99=== modified file 'tests/basic_deployment.py'
100--- tests/basic_deployment.py 2015-01-05 14:40:20 +0000
101+++ tests/basic_deployment.py 2015-01-13 11:55:06 +0000
102@@ -430,12 +430,6 @@
103 'nova-cloud-controller:amqp')
104 glance_relation = self.glance_sentry.relation('image-service',
105 'nova-cloud-controller:image-service')
106- mysql_relation = self.mysql_sentry.relation('shared-db',
107- 'nova-cloud-controller:shared-db')
108- db_uri = "mysql://{}:{}@{}/{}".format('nova',
109- mysql_relation['nova_password'],
110- mysql_relation['db_host'],
111- 'nova')
112 keystone_ep = self.keystone_demo.service_catalog.url_for(\
113 service_type='identity',
114 endpoint_type='publicURL')
115@@ -460,7 +454,6 @@
116 'auth_strategy': 'keystone',
117 'compute_driver': 'libvirt.LibvirtDriver',
118 'keystone_ec2_url': keystone_ec2,
119- 'sql_connection': db_uri,
120 'rabbit_userid': 'nova',
121 'rabbit_virtual_host': 'openstack',
122 'rabbit_password': rabbitmq_relation['password'],
123@@ -471,11 +464,43 @@
124 'osapi_compute_listen_port': '8764',
125 'ec2_listen_port': '8763'}
126
127+ # This has been moved to [database] for I and above
128+ if self._get_openstack_release() < self.precise_icehouse:
129+ mysql_relation = self.mysql_sentry.relation('shared-db',
130+ 'nova-cloud-controller:shared-db')
131+ db_uri = "mysql://{}:{}@{}/{}".format('nova',
132+ mysql_relation['nova_password'],
133+ mysql_relation['db_host'],
134+ 'nova')
135+ expected['sql_connection'] = db_uri
136+
137 ret = u.validate_config_data(unit, conf, 'DEFAULT', expected)
138 if ret:
139 message = "nova config error: {}".format(ret)
140 amulet.raise_status(amulet.FAIL, msg=message)
141
142+ def test_nova_database_config(self):
143+ """Verify the data in the nova config file's database section."""
144+ # NOTE(hopem): this is >= Icehouse only
145+ if self._get_openstack_release() < self.precise_icehouse:
146+ return
147+
148+ unit = self.nova_cc_sentry
149+ conf = '/etc/nova/nova.conf'
150+ mysql_relation = self.mysql_sentry.relation('shared-db',
151+ 'nova-cloud-controller:shared-db')
152+ db_uri = "mysql://{}:{}@{}/{}".format('nova',
153+ mysql_relation['nova_password'],
154+ mysql_relation['db_host'],
155+ 'nova')
156+
157+ # For >= icehouse we move away from deprecated sql_connection
158+ expected = {'connection': db_uri}
159+
160+ ret = u.validate_config_data(unit, conf, 'database', expected)
161+ if ret:
162+ message = "nova config error: {}".format(ret)
163+ amulet.raise_status(amulet.FAIL, msg=message)
164
165 def test_nova_keystone_authtoken_config(self):
166 """Verify the data in the nova config file's keystone_authtoken
167@@ -526,7 +551,7 @@
168 found = True
169 if instance.status != 'ACTIVE':
170 msg = "cirros instance is not active"
171- amulet.raise_status(amulet.FAIL, msg=message)
172+ amulet.raise_status(amulet.FAIL, msg=msg)
173
174 if not found:
175 message = "nova cirros instance does not exist"

Subscribers

People subscribed via source and target branches