Also added mysqlconnector packages into default installation.
blueprint enable-mysql-connector
Change-Id: Ib2cda7cb183dc8f0ff4759cc6e9ecab469fd121c
... | ... |
@@ -6,6 +6,7 @@ parted |
6 | 6 |
iputils-arping |
7 | 7 |
mysql-server # NOPRIME |
8 | 8 |
python-mysqldb |
9 |
+python-mysql.connector |
|
9 | 10 |
python-xattr # needed for glance which is needed for nova --- this shouldn't be here |
10 | 11 |
python-lxml # needed for glance which is needed for nova --- this shouldn't be here |
11 | 12 |
gawk |
... | ... |
@@ -35,6 +35,7 @@ python-lockfile |
35 | 35 |
python-lxml # needed for glance which is needed for nova --- this shouldn't be here |
36 | 36 |
python-mox |
37 | 37 |
python-mysql |
38 |
+python-mysql.connector |
|
38 | 39 |
python-numpy # needed by websockify for spice console |
39 | 40 |
python-paramiko |
40 | 41 |
python-sqlalchemy-migrate |
... | ... |
@@ -89,7 +89,7 @@ function initialize_database_backends { |
89 | 89 |
# a multi-node DevStack installation. |
90 | 90 |
|
91 | 91 |
# NOTE: Don't specify ``/db`` in this string so we can use it for multiple services |
92 |
- BASE_SQL_CONN=${BASE_SQL_CONN:-${DATABASE_TYPE}://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOST} |
|
92 |
+ BASE_SQL_CONN=${BASE_SQL_CONN:-$(get_database_type)://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOST} |
|
93 | 93 |
|
94 | 94 |
return 0 |
95 | 95 |
} |
... | ... |
@@ -120,6 +120,14 @@ function database_connection_url { |
120 | 120 |
database_connection_url_$DATABASE_TYPE $db |
121 | 121 |
} |
122 | 122 |
|
123 |
+function get_database_type { |
|
124 |
+ if [[ -n "${SQLALCHEMY_DATABASE_DRIVER}" ]]; then |
|
125 |
+ echo "${DATABASE_TYPE}+${SQLALCHEMY_DATABASE_DRIVER}" |
|
126 |
+ else |
|
127 |
+ echo "${DATABASE_TYPE}" |
|
128 |
+ fi |
|
129 |
+} |
|
130 |
+ |
|
123 | 131 |
|
124 | 132 |
# Restore xtrace |
125 | 133 |
$XTRACE |
... | ... |
@@ -52,6 +52,18 @@ if [[ -z "$ENABLED_SERVICES" ]]; then |
52 | 52 |
ENABLED_SERVICES+=,rabbit,tempest,mysql |
53 | 53 |
fi |
54 | 54 |
|
55 |
+# SQLAlchemy supports multiple database drivers for each database server |
|
56 |
+# type. For example, deployer may use MySQLdb, MySQLConnector, or oursql |
|
57 |
+# to access MySQL database. |
|
58 |
+# |
|
59 |
+# When defined, the variable controls which database driver is used to |
|
60 |
+# connect to database server. Otherwise using default driver defined for |
|
61 |
+# each database type. |
|
62 |
+# |
|
63 |
+# You can find the list of currently supported drivers for each database |
|
64 |
+# type at: http://docs.sqlalchemy.org/en/rel_0_9/core/engines.html |
|
65 |
+# SQLALCHEMY_DATABASE_DRIVER="mysqldb" |
|
66 |
+ |
|
55 | 67 |
# Global toggle for enabling services under mod_wsgi. If this is set to |
56 | 68 |
# ``True`` all services that use HTTPD + mod_wsgi as the preferred method of |
57 | 69 |
# deployment, will be deployed under Apache. If this is set to ``False`` all |