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:
parent
185a761624
commit
f08e9f1f53
etc
neutron
db/migration
plugins/brocade
tests
@ -708,7 +708,7 @@ admin_password = %SERVICE_PASSWORD%
|
|||||||
[database]
|
[database]
|
||||||
# This line MUST be changed to actually run the plugin.
|
# This line MUST be changed to actually run the plugin.
|
||||||
# Example:
|
# 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
|
# 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.)
|
# main neutron server. (Leave it as is if the database runs on this host.)
|
||||||
# connection = sqlite://
|
# connection = sqlite://
|
||||||
|
@ -32,4 +32,4 @@
|
|||||||
# root_helper = sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
|
# root_helper = sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
|
||||||
|
|
||||||
[database]
|
[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
|
||||||
|
@ -32,7 +32,7 @@ Known Limitations:
|
|||||||
Example usage:
|
Example usage:
|
||||||
|
|
||||||
python -m neutron.db.migration.migrate_to_ml2 openvswitch \
|
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
|
Note that migration of tunneling state will only be attempted if the
|
||||||
--tunnel-type parameter is provided.
|
--tunnel-type parameter is provided.
|
||||||
|
@ -76,7 +76,7 @@ the configuration file specified in the brocade.ini files:
|
|||||||
ostype = NOS
|
ostype = NOS
|
||||||
|
|
||||||
[database]
|
[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)
|
(please see list of more configuration parameters in the brocade.ini file)
|
||||||
|
|
||||||
|
@ -52,10 +52,11 @@ class BaseFullStackTestCase(test_base.MySQLOpportunisticTestCase):
|
|||||||
we only support MySQL for now, but the groundwork for adding Postgres
|
we only support MySQL for now, but the groundwork for adding Postgres
|
||||||
is already laid.
|
is already laid.
|
||||||
"""
|
"""
|
||||||
conn = "mysql://%(username)s:%(password)s@127.0.0.1/%(db_name)s" % {
|
conn = ("mysql+pymysql://%(username)s:%(password)s"
|
||||||
'username': test_base.DbFixture.USERNAME,
|
"@127.0.0.1/%(db_name)s" % {
|
||||||
'password': test_base.DbFixture.PASSWORD,
|
'username': test_base.DbFixture.USERNAME,
|
||||||
'db_name': self.engine.url.database}
|
'password': test_base.DbFixture.PASSWORD,
|
||||||
|
'db_name': self.engine.url.database})
|
||||||
|
|
||||||
self.original_conn = cfg.CONF.database.connection
|
self.original_conn = cfg.CONF.database.connection
|
||||||
self.addCleanup(self._revert_connection_address)
|
self.addCleanup(self._revert_connection_address)
|
||||||
|
@ -5,4 +5,4 @@
|
|||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
|
|
||||||
psycopg2
|
psycopg2
|
||||||
MySQL-python
|
PyMySQL>=0.6.2 # MIT License
|
||||||
|
Loading…
x
Reference in New Issue
Block a user