From 11dca03384cfd92c28cf5e63c1ff0098e96198df Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Wed, 20 May 2015 01:04:01 +0000 Subject: [PATCH] Switch from MySQL-python to PyMySQL As discussed in the Liberty Design Summit "Moving apps to Python 3" cross-project workshop, the way forward in the near future is to switch to the pure-python PyMySQL library as a default. https://etherpad.openstack.org/p/liberty-cross-project-python3 Change-Id: I35ac53ec8a51ef0037c81aa939b871c9d037272d --- zaqar/storage/sqlalchemy/driver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zaqar/storage/sqlalchemy/driver.py b/zaqar/storage/sqlalchemy/driver.py index 85e977e09..ee7f268e2 100644 --- a/zaqar/storage/sqlalchemy/driver.py +++ b/zaqar/storage/sqlalchemy/driver.py @@ -57,7 +57,8 @@ class ControlDriver(storage.ControlDriverBase): sa.event.listen(engine, 'connect', self._sqlite_on_connect) - if uri.startswith('mysql://'): + if (uri.startswith('mysql+pymysql://') + or uri.startswith('mysql://')): sa.event.listen(engine, 'connect', self._mysql_on_connect)