]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Switch from MySQL-python to PyMySQL
authorJeremy Stanley <fungi@yuggoth.org>
Wed, 20 May 2015 01:03:59 +0000 (01:03 +0000)
committerHenry Gessau <gessau@cisco.com>
Tue, 9 Jun 2015 23:48:20 +0000 (19:48 -0400)
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

etc/neutron.conf
etc/neutron/plugins/oneconvergence/nvsdplugin.ini
neutron/db/migration/migrate_to_ml2.py
neutron/plugins/brocade/README.md
neutron/tests/fullstack/base.py
neutron/tests/functional/requirements.txt

index 5b58519d0eab97a0d1b83da35e2803adedbe5590..7a11b939fb51271050c545b45f2fb38b66f04894 100755 (executable)
@@ -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://
index a1c05d971e3e95fd011aae08dd7eab6388026bc2..2d8cc77a5046bf78f1d3bc61c580ff7d81819cc2 100644 (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
index e6c5db332fdfbc50f2d57654be98024b36701323..e1b9579bcd5280202bfd91b1ad744a72e5354387 100755 (executable)
@@ -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.
index 82b3ad89d8326e67cfff99103209ada7770a8fb5..1baa312474658cefe72523470e3fe1deb399b26b 100644 (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)
 
index 9fed9f3e6214bc87e265522383d8eefc6315efce..c886bd5e790acc08b62e812b8c39e340e84f15b1 100644 (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)
index 0c5f2215b448eaecc4ba07e12345e23c58c78448..2d664cb354a5c1f0c09f72549c5af1b3a03900c9 100644 (file)
@@ -5,4 +5,4 @@
 # process, which may cause wedges in the gate later.
 
 psycopg2
-MySQL-python
+PyMySQL>=0.6.2  # MIT License