Merge lp:~hopem/charms/trusty/nova-cloud-controller/nova-alchemy-flags into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
- Trusty Tahr (14.04)
- nova-alchemy-flags
- Merge into next
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Liam Young (community) | Approve | ||
Review via email: mp+245451@code.launchpad.net |
Commit message
Description of the change
Edward Hope-Morley (hopem) wrote : | # |
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #579 nova-cloud-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #608 nova-cloud-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #734 nova-cloud-
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://
Build: http://
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #580 nova-cloud-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #609 nova-cloud-
UNIT OK: passed
- 136. By Edward Hope-Morley
-
fixed amulet test error and lint issue in tests/basic_
deployment. py
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #581 nova-cloud-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #610 nova-cloud-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #768 nova-cloud-
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://
Build: http://
- 137. By Edward Hope-Morley
-
fix amulet
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_lint_check #717 nova-cloud-
LINT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_unit_test #746 nova-cloud-
UNIT OK: passed
uosci-testing-bot (uosci-testing-bot) wrote : | # |
charm_amulet_test #902 nova-cloud-
AMULET OK: passed
Preview Diff
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 | 30 | default: nova | 30 | default: nova |
6 | 31 | type: string | 31 | type: string |
7 | 32 | description: Database name | 32 | description: Database name |
8 | 33 | nova-alchemy-flags: | ||
9 | 34 | type: string | ||
10 | 35 | default: | ||
11 | 36 | description: | | ||
12 | 37 | Comma-separated list of key=value sqlalchemy related config flags to be | ||
13 | 38 | set in nova.conf [database] section. | ||
14 | 33 | neutron-database-user: | 39 | neutron-database-user: |
15 | 34 | default: neutron | 40 | default: neutron |
16 | 35 | type: string | 41 | type: string |
17 | @@ -38,6 +44,12 @@ | |||
18 | 38 | default: neutron | 44 | default: neutron |
19 | 39 | type: string | 45 | type: string |
20 | 40 | description: Database name for Neutron (if enabled) | 46 | description: Database name for Neutron (if enabled) |
21 | 47 | neutron-alchemy-flags: | ||
22 | 48 | type: string | ||
23 | 49 | default: | ||
24 | 50 | description: | | ||
25 | 51 | Comma-separated list of key=value sqlalchemy related config flags to be | ||
26 | 52 | set in neutron.conf [database] section. | ||
27 | 41 | network-manager: | 53 | network-manager: |
28 | 42 | default: FlatDHCPManager | 54 | default: FlatDHCPManager |
29 | 43 | type: string | 55 | type: string |
30 | @@ -139,12 +151,6 @@ | |||
31 | 139 | type: string | 151 | type: string |
32 | 140 | default: | 152 | default: |
33 | 141 | description: SSL key to use with certificate specified as ssl_cert. | 153 | description: SSL key to use with certificate specified as ssl_cert. |
34 | 142 | neutron-alchemy-flags: | ||
35 | 143 | type: string | ||
36 | 144 | default: | ||
37 | 145 | description: | | ||
38 | 146 | Comma separated list of key=value sqlalchemy related config flags to be | ||
39 | 147 | set in plugin ini file. | ||
40 | 148 | ssl_ca: | 154 | ssl_ca: |
41 | 149 | type: string | 155 | type: string |
42 | 150 | default: | 156 | default: |
43 | 151 | 157 | ||
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 | 110 | 'contexts': [context.AMQPContext(ssl_dir=NOVA_CONF_DIR), | 110 | 'contexts': [context.AMQPContext(ssl_dir=NOVA_CONF_DIR), |
49 | 111 | context.SharedDBContext( | 111 | context.SharedDBContext( |
50 | 112 | relation_prefix='nova', ssl_dir=NOVA_CONF_DIR), | 112 | relation_prefix='nova', ssl_dir=NOVA_CONF_DIR), |
51 | 113 | context.OSConfigFlagContext( | ||
52 | 114 | charm_flag='nova-alchemy-flags', | ||
53 | 115 | template_flag='nova_alchemy_flags'), | ||
54 | 113 | nova_cc_context.NovaPostgresqlDBContext(), | 116 | nova_cc_context.NovaPostgresqlDBContext(), |
55 | 114 | context.ImageServiceContext(), | 117 | context.ImageServiceContext(), |
56 | 115 | context.OSConfigFlagContext(), | 118 | context.OSConfigFlagContext(), |
57 | 116 | 119 | ||
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 | 46 | keystone_ec2_url = {{ keystone_ec2_url }} | 46 | keystone_ec2_url = {{ keystone_ec2_url }} |
63 | 47 | {% endif -%} | 47 | {% endif -%} |
64 | 48 | 48 | ||
65 | 49 | {% include "parts/database" %} | ||
66 | 50 | |||
67 | 51 | {% include "parts/rabbitmq" %} | 49 | {% include "parts/rabbitmq" %} |
68 | 52 | 50 | ||
69 | 53 | {% if glance_api_servers -%} | 51 | {% if glance_api_servers -%} |
70 | @@ -134,7 +132,9 @@ | |||
71 | 134 | {% for key, value in sections['DEFAULT'] -%} | 132 | {% for key, value in sections['DEFAULT'] -%} |
72 | 135 | {{ key }} = {{ value }} | 133 | {{ key }} = {{ value }} |
73 | 136 | {% endfor -%} | 134 | {% endfor -%} |
75 | 137 | {% endif -%} | 135 | {% endif %} |
76 | 136 | |||
77 | 137 | {% include "parts/database-v2" %} | ||
78 | 138 | 138 | ||
79 | 139 | {% if auth_host -%} | 139 | {% if auth_host -%} |
80 | 140 | [keystone_authtoken] | 140 | [keystone_authtoken] |
81 | 141 | 141 | ||
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 | 1 | [database] | ||
87 | 2 | {% if database_host -%} | ||
88 | 3 | 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 | 4 | {% endif -%} | ||
90 | 5 | {% if not nova_alchemy_flags or 'max_pool_size' not in nova_alchemy_flags.iterkeys() -%} | ||
91 | 6 | max_pool_size = {{ workers }} | ||
92 | 7 | {% endif -%} | ||
93 | 8 | {% if nova_alchemy_flags -%} | ||
94 | 9 | {% for key, value in nova_alchemy_flags.iteritems() -%} | ||
95 | 10 | {{ key }} = {{ value }} | ||
96 | 11 | {% endfor -%} | ||
97 | 12 | {% endif -%} | ||
98 | 0 | 13 | ||
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 | 430 | 'nova-cloud-controller:amqp') | 430 | 'nova-cloud-controller:amqp') |
104 | 431 | glance_relation = self.glance_sentry.relation('image-service', | 431 | glance_relation = self.glance_sentry.relation('image-service', |
105 | 432 | 'nova-cloud-controller:image-service') | 432 | 'nova-cloud-controller:image-service') |
106 | 433 | mysql_relation = self.mysql_sentry.relation('shared-db', | ||
107 | 434 | 'nova-cloud-controller:shared-db') | ||
108 | 435 | db_uri = "mysql://{}:{}@{}/{}".format('nova', | ||
109 | 436 | mysql_relation['nova_password'], | ||
110 | 437 | mysql_relation['db_host'], | ||
111 | 438 | 'nova') | ||
112 | 439 | keystone_ep = self.keystone_demo.service_catalog.url_for(\ | 433 | keystone_ep = self.keystone_demo.service_catalog.url_for(\ |
113 | 440 | service_type='identity', | 434 | service_type='identity', |
114 | 441 | endpoint_type='publicURL') | 435 | endpoint_type='publicURL') |
115 | @@ -460,7 +454,6 @@ | |||
116 | 460 | 'auth_strategy': 'keystone', | 454 | 'auth_strategy': 'keystone', |
117 | 461 | 'compute_driver': 'libvirt.LibvirtDriver', | 455 | 'compute_driver': 'libvirt.LibvirtDriver', |
118 | 462 | 'keystone_ec2_url': keystone_ec2, | 456 | 'keystone_ec2_url': keystone_ec2, |
119 | 463 | 'sql_connection': db_uri, | ||
120 | 464 | 'rabbit_userid': 'nova', | 457 | 'rabbit_userid': 'nova', |
121 | 465 | 'rabbit_virtual_host': 'openstack', | 458 | 'rabbit_virtual_host': 'openstack', |
122 | 466 | 'rabbit_password': rabbitmq_relation['password'], | 459 | 'rabbit_password': rabbitmq_relation['password'], |
123 | @@ -471,11 +464,43 @@ | |||
124 | 471 | 'osapi_compute_listen_port': '8764', | 464 | 'osapi_compute_listen_port': '8764', |
125 | 472 | 'ec2_listen_port': '8763'} | 465 | 'ec2_listen_port': '8763'} |
126 | 473 | 466 | ||
127 | 467 | # This has been moved to [database] for I and above | ||
128 | 468 | if self._get_openstack_release() < self.precise_icehouse: | ||
129 | 469 | mysql_relation = self.mysql_sentry.relation('shared-db', | ||
130 | 470 | 'nova-cloud-controller:shared-db') | ||
131 | 471 | db_uri = "mysql://{}:{}@{}/{}".format('nova', | ||
132 | 472 | mysql_relation['nova_password'], | ||
133 | 473 | mysql_relation['db_host'], | ||
134 | 474 | 'nova') | ||
135 | 475 | expected['sql_connection'] = db_uri | ||
136 | 476 | |||
137 | 474 | ret = u.validate_config_data(unit, conf, 'DEFAULT', expected) | 477 | ret = u.validate_config_data(unit, conf, 'DEFAULT', expected) |
138 | 475 | if ret: | 478 | if ret: |
139 | 476 | message = "nova config error: {}".format(ret) | 479 | message = "nova config error: {}".format(ret) |
140 | 477 | amulet.raise_status(amulet.FAIL, msg=message) | 480 | amulet.raise_status(amulet.FAIL, msg=message) |
141 | 478 | 481 | ||
142 | 482 | def test_nova_database_config(self): | ||
143 | 483 | """Verify the data in the nova config file's database section.""" | ||
144 | 484 | # NOTE(hopem): this is >= Icehouse only | ||
145 | 485 | if self._get_openstack_release() < self.precise_icehouse: | ||
146 | 486 | return | ||
147 | 487 | |||
148 | 488 | unit = self.nova_cc_sentry | ||
149 | 489 | conf = '/etc/nova/nova.conf' | ||
150 | 490 | mysql_relation = self.mysql_sentry.relation('shared-db', | ||
151 | 491 | 'nova-cloud-controller:shared-db') | ||
152 | 492 | db_uri = "mysql://{}:{}@{}/{}".format('nova', | ||
153 | 493 | mysql_relation['nova_password'], | ||
154 | 494 | mysql_relation['db_host'], | ||
155 | 495 | 'nova') | ||
156 | 496 | |||
157 | 497 | # For >= icehouse we move away from deprecated sql_connection | ||
158 | 498 | expected = {'connection': db_uri} | ||
159 | 499 | |||
160 | 500 | ret = u.validate_config_data(unit, conf, 'database', expected) | ||
161 | 501 | if ret: | ||
162 | 502 | message = "nova config error: {}".format(ret) | ||
163 | 503 | amulet.raise_status(amulet.FAIL, msg=message) | ||
164 | 479 | 504 | ||
165 | 480 | def test_nova_keystone_authtoken_config(self): | 505 | def test_nova_keystone_authtoken_config(self): |
166 | 481 | """Verify the data in the nova config file's keystone_authtoken | 506 | """Verify the data in the nova config file's keystone_authtoken |
167 | @@ -526,7 +551,7 @@ | |||
168 | 526 | found = True | 551 | found = True |
169 | 527 | if instance.status != 'ACTIVE': | 552 | if instance.status != 'ACTIVE': |
170 | 528 | msg = "cirros instance is not active" | 553 | msg = "cirros instance is not active" |
172 | 529 | amulet.raise_status(amulet.FAIL, msg=message) | 554 | amulet.raise_status(amulet.FAIL, msg=msg) |
173 | 530 | 555 | ||
174 | 531 | if not found: | 556 | if not found: |
175 | 532 | message = "nova cirros instance does not exist" | 557 | message = "nova cirros instance does not exist" |
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.