Add ability to switch database driver

Also added mysqlconnector packages into default installation.

blueprint enable-mysql-connector

Change-Id: Ib2cda7cb183dc8f0ff4759cc6e9ecab469fd121c
This commit is contained in:
ihrachyshka 2014-06-28 18:09:54 +02:00 committed by Ihar Hrachyshka
parent 735f4d340f
commit cbea3447c7
10 changed files with 29 additions and 1 deletions

View File

@ -6,6 +6,7 @@ sqlite3
python-pysqlite2 python-pysqlite2
python-sqlalchemy python-sqlalchemy
python-mysqldb python-mysqldb
python-mysql.connector
python-webob python-webob
python-greenlet python-greenlet
python-routes python-routes

View File

@ -15,6 +15,7 @@ python-kombu
python-eventlet python-eventlet
python-sqlalchemy python-sqlalchemy
python-mysqldb python-mysqldb
python-mysql.connector
python-pyudev python-pyudev
python-qpid # dist:precise python-qpid # dist:precise
dnsmasq-base dnsmasq-base

View File

@ -6,6 +6,7 @@ parted
iputils-arping iputils-arping
mysql-server # NOPRIME mysql-server # NOPRIME
python-mysqldb python-mysqldb
python-mysql.connector
python-xattr # needed for glance which is needed for nova --- this shouldn't be here python-xattr # needed for glance which is needed for nova --- this shouldn't be here
python-lxml # needed for glance which is needed for nova --- this shouldn't be here python-lxml # needed for glance which is needed for nova --- this shouldn't be here
gawk gawk

View File

@ -10,5 +10,6 @@ python-devel
python-greenlet python-greenlet
python-lxml python-lxml
python-mysql python-mysql
python-mysql.connector
python-pysqlite python-pysqlite
sqlite3 sqlite3

View File

@ -10,6 +10,7 @@ python-greenlet
python-iso8601 python-iso8601
python-kombu python-kombu
python-mysql python-mysql
python-mysql.connector
python-Paste python-Paste
python-PasteDeploy python-PasteDeploy
python-pyudev python-pyudev

View File

@ -35,6 +35,7 @@ python-lockfile
python-lxml # needed for glance which is needed for nova --- this shouldn't be here python-lxml # needed for glance which is needed for nova --- this shouldn't be here
python-mox python-mox
python-mysql python-mysql
python-mysql.connector
python-numpy # needed by websockify for spice console python-numpy # needed by websockify for spice console
python-paramiko python-paramiko
python-sqlalchemy-migrate python-sqlalchemy-migrate

View File

@ -4,6 +4,7 @@ dnsmasq-utils # for dhcp_release
ebtables ebtables
iptables iptables
iputils iputils
mysql-connector-python
mysql-server # NOPRIME mysql-server # NOPRIME
openvswitch # NOPRIME openvswitch # NOPRIME
python-boto python-boto

View File

@ -15,6 +15,7 @@ libvirt-python # NOPRIME
libxml2-python libxml2-python
numpy # needed by websockify for spice console numpy # needed by websockify for spice console
m2crypto m2crypto
mysql-connector-python
mysql-server # NOPRIME mysql-server # NOPRIME
parted parted
polkit polkit

View File

@ -89,7 +89,7 @@ function initialize_database_backends {
# a multi-node DevStack installation. # a multi-node DevStack installation.
# NOTE: Don't specify ``/db`` in this string so we can use it for multiple services # NOTE: Don't specify ``/db`` in this string so we can use it for multiple services
BASE_SQL_CONN=${BASE_SQL_CONN:-${DATABASE_TYPE}://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOST} BASE_SQL_CONN=${BASE_SQL_CONN:-$(get_database_type)://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOST}
return 0 return 0
} }
@ -120,6 +120,14 @@ function database_connection_url {
database_connection_url_$DATABASE_TYPE $db database_connection_url_$DATABASE_TYPE $db
} }
function get_database_type {
if [[ -n "${SQLALCHEMY_DATABASE_DRIVER}" ]]; then
echo "${DATABASE_TYPE}+${SQLALCHEMY_DATABASE_DRIVER}"
else
echo "${DATABASE_TYPE}"
fi
}
# Restore xtrace # Restore xtrace
$XTRACE $XTRACE

12
stackrc
View File

@ -52,6 +52,18 @@ if [[ -z "$ENABLED_SERVICES" ]]; then
ENABLED_SERVICES+=,rabbit,tempest,mysql ENABLED_SERVICES+=,rabbit,tempest,mysql
fi fi
# SQLAlchemy supports multiple database drivers for each database server
# type. For example, deployer may use MySQLdb, MySQLConnector, or oursql
# to access MySQL database.
#
# When defined, the variable controls which database driver is used to
# connect to database server. Otherwise using default driver defined for
# each database type.
#
# You can find the list of currently supported drivers for each database
# type at: http://docs.sqlalchemy.org/en/rel_0_9/core/engines.html
# SQLALCHEMY_DATABASE_DRIVER="mysqldb"
# Global toggle for enabling services under mod_wsgi. If this is set to # Global toggle for enabling services under mod_wsgi. If this is set to
# ``True`` all services that use HTTPD + mod_wsgi as the preferred method of # ``True`` all services that use HTTPD + mod_wsgi as the preferred method of
# deployment, will be deployed under Apache. If this is set to ``False`` all # deployment, will be deployed under Apache. If this is set to ``False`` all