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: I73e0fdb6eca70e7d029a40a2f6f17a7c0797a21d
This commit is contained in:
Jeremy Stanley 2015-05-20 01:03:59 +00:00 committed by Henry Gessau
parent 185a761624
commit f08e9f1f53
6 changed files with 10 additions and 9 deletions

View File

@ -708,7 +708,7 @@ admin_password = %SERVICE_PASSWORD%
[database]
# This line MUST be changed to actually run the plugin.
# Example:
# connection = mysql://root:pass@127.0.0.1:3306/neutron
# connection = mysql+pymysql://root:pass@127.0.0.1:3306/neutron
# Replace 127.0.0.1 above with the IP address of the database used by the
# main neutron server. (Leave it as is if the database runs on this host.)
# connection = sqlite://

View File

@ -32,4 +32,4 @@
# root_helper = sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
[database]
# connection = mysql://root:<passwd>@127.0.0.1/<neutron_db>?charset=utf8
# connection = mysql+pymysql://root:<passwd>@127.0.0.1/<neutron_db>?charset=utf8

View File

@ -32,7 +32,7 @@ Known Limitations:
Example usage:
python -m neutron.db.migration.migrate_to_ml2 openvswitch \
mysql://login:pass@127.0.0.1/neutron
mysql+pymysql://login:pass@127.0.0.1/neutron
Note that migration of tunneling state will only be attempted if the
--tunnel-type parameter is provided.

View File

@ -76,7 +76,7 @@ the configuration file specified in the brocade.ini files:
ostype = NOS
[database]
connection = mysql://root:pass@localhost/brocade_neutron?charset=utf8
connection = mysql+pymysql://root:pass@localhost/brocade_neutron?charset=utf8
(please see list of more configuration parameters in the brocade.ini file)

View File

@ -52,10 +52,11 @@ class BaseFullStackTestCase(test_base.MySQLOpportunisticTestCase):
we only support MySQL for now, but the groundwork for adding Postgres
is already laid.
"""
conn = "mysql://%(username)s:%(password)s@127.0.0.1/%(db_name)s" % {
'username': test_base.DbFixture.USERNAME,
'password': test_base.DbFixture.PASSWORD,
'db_name': self.engine.url.database}
conn = ("mysql+pymysql://%(username)s:%(password)s"
"@127.0.0.1/%(db_name)s" % {
'username': test_base.DbFixture.USERNAME,
'password': test_base.DbFixture.PASSWORD,
'db_name': self.engine.url.database})
self.original_conn = cfg.CONF.database.connection
self.addCleanup(self._revert_connection_address)

View File

@ -5,4 +5,4 @@
# process, which may cause wedges in the gate later.
psycopg2
MySQL-python
PyMySQL>=0.6.2 # MIT License