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

Also set the OS_TEST_DBAPI_ADMIN_CONNECTION override variable so
that oslo.db opportunistic detection will know to use PyMySQL until
I12b32dc097a121bd43991bc38dd4d289b65e86c1 makes it the default
behavior.

Change-Id: I17e052215ce6e1604cdda848ccc20862452ccbc7
Co-Authored-By: Victor Sergeyev <vsergeyev@mirantis.com>
changes/76/184376/2
Jeremy Stanley 8 years ago
parent 60300b0149
commit f6e34c9017
  1. 4
      doc/source/scale_deployment.rst
  2. 2
      install.sh
  3. 2
      test-requirements.txt
  4. 1
      tox.ini

@ -284,7 +284,7 @@ The original file from A looks like:
[DEFAULT]
...
sql_connection = mysql://root:admin@127.0.0.1/heat?charset=utf8
sql_connection = mysql+pymysql://root:admin@127.0.0.1/heat?charset=utf8
rabbit_host = localhost
...
[heat_api]
@ -300,7 +300,7 @@ After the changes for B, it looks like:
[DEFAULT]
...
sql_connection = mysql://root:admin@10.0.0.1/heat?charset=utf8
sql_connection = mysql+pymysql://root:admin@10.0.0.1/heat?charset=utf8
rabbit_host = 10.0.0.1
...
[heat_api]

@ -73,7 +73,7 @@ basic_configuration() {
if echo $conf_path | grep ".conf$" >/dev/null 2>&1
then
iniset $target DEFAULT auth_encryption_key `hexdump -n 16 -v -e '/1 "%02x"' /dev/random`
iniset $target database connection "mysql://heat:heat@localhost/heat"
iniset $target database connection "mysql+pymysql://heat:heat@localhost/heat"
BRIDGE_IP=127.0.0.1
iniset $target DEFAULT heat_metadata_server_url "http://${BRIDGE_IP}:8000/"

@ -8,7 +8,7 @@ coverage>=3.6
discover
mock>=1.0
mox>=0.5.3
MySQL-python
PyMySQL>=0.6.2 # MIT License
oslosphinx>=2.5.0 # Apache-2.0
oslotest>=1.5.1 # Apache-2.0
paramiko>=1.13.0

@ -7,6 +7,7 @@ skipsdist = True
# Note the hash seed is set to 0 until heat can be tested with a
# random hash seed successfully.
setenv = VIRTUAL_ENV={envdir}
OS_TEST_DBAPI_ADMIN_CONNECTION=mysql+pymysql://openstack_citest:openstack_citest@localhost/;postgresql://openstack_citest:openstack_citest@localhost/postgres;sqlite://
PYTHONHASHSEED=0
usedevelop = True
install_command = pip install {opts} {packages}

Loading…
Cancel
Save