Fix database connection section

Using the sql_connection option in the default section appears to
cause CONF.api_database.connection to be populated with the
connection uri. This in turn causes nova to think this is an
api cell and to do an api lookup *1 which fails. This change moves
the database connection string into its own section as per *2

*1 https://opendev.org/openstack/nova/src/branch/master/nova/utils.py#L1060
*2 https://docs.openstack.org/nova/latest/admin/cells.html

Closes-Bug: #1982071
Change-Id: I49859235d408598535173c8bb87ce65f66fb3ca8
This commit is contained in:
Liam Young 2022-07-19 06:30:46 +00:00
parent c9f9802fdd
commit d668de8aa5
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
# train
###############################################################################
# [ WARNING ]
# Configuration file maintained by Juju. Local changes may be overwritten.
###############################################################################
[DEFAULT]
verbose={{ options.verbose }}
debug={{ options.debug }}
logdir=/var/log/nova
state_path=/var/lib/nova
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf
{% include "parts/section-transport-url" %}
[conductor]
workers = {{ options.workers }}
{% include "parts/section-oslo-messaging-rabbit" %}
{% include "parts/section-placement" %}
[database]
{% if shared_db.host -%}
connection = {{ shared_db.uri }}
{% endif -%}