Merge "Fix stacking without preconfigured DATABASE_PASSWORD"

This commit is contained in:
Zuul 2022-01-04 18:33:26 +00:00 committed by Gerrit Code Review
commit 7b0251cf37
2 changed files with 6 additions and 2 deletions

View File

@ -89,6 +89,10 @@ function initialize_database_backends {
DATABASE_PASSWORD=$MYSQL_PASSWORD
fi
return 0
}
function define_database_baseurl {
# We configure Nova, Horizon, Glance and Keystone to use MySQL as their
# database server. While they share a single server, each has their own
# database and tables.
@ -100,8 +104,6 @@ function initialize_database_backends {
# NOTE: Don't specify ``/db`` in this string so we can use it for multiple services
BASE_SQL_CONN=${BASE_SQL_CONN:-$(get_database_type_$DATABASE_TYPE)://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOST}
return 0
}
# Recreate a given database

View File

@ -697,6 +697,8 @@ if initialize_database_backends; then
# Last chance for the database password. This must be handled here
# because read_password is not a library function.
read_password DATABASE_PASSWORD "ENTER A PASSWORD TO USE FOR THE DATABASE."
define_database_baseurl
else
echo "No database enabled"
fi