optional pymysql support

This allows you to specify MYSQL_DRIVER=PyMySQL and get it in the
environment.

Change-Id: Ic9d75266640b7aa6d7efb6e882d3027e81414059
This commit is contained in:
Sean Dague 2015-05-20 06:37:11 -07:00
parent 5dd889f4e1
commit 37421991b4
2 changed files with 11 additions and 3 deletions

View File

@ -1,7 +1,6 @@
# Once we can prebuild wheels before a devstack run, uncomment the skipped libraries
cryptography
# lxml # still install from from packages
MySQL-python
# netifaces # still install from packages
#numpy # slowest wheel by far, stop building until we are actually using the output
posix-ipc

View File

@ -11,6 +11,13 @@
MY_XTRACE=$(set +o | grep xtrace)
set +o xtrace
MYSQL_DRIVER=${MYSQL_DRIVER:-MySQL-python}
# Force over to pymysql driver by default if we are using it.
if is_service_enabled mysql; then
if [[ "$MYSQL_DRIVER" == "PyMySQL" ]]; then
SQLALCHEMY_DATABASE_DRIVER=${SQLALCHEMY_DATABASE_DRIVER:-"pymysql"}
fi
fi
register_database mysql
@ -155,8 +162,10 @@ EOF
function install_database_python_mysql {
# Install Python client module
pip_install_gr MySQL-python
ADDITIONAL_VENV_PACKAGES+=",MySQL-python"
pip_install_gr $MYSQL_DRIVER
if [[ "$MYSQL_DRIVER" == "MySQL-python" ]]; then
ADDITIONAL_VENV_PACKAGES+=",MySQL-python"
fi
}
function database_connection_url_mysql {