Switch from MySQL-python to PyMySQL
PyMySQL, unlike MySQL-python, is a pure-python implementation with support for Py3K. Change-Id: I110c85fa7d57a6ab121437f93238cf931a8f2d74
This commit is contained in:
parent
2766a5a126
commit
63e5297f7e
@ -65,7 +65,7 @@ documentation
|
||||
<http://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls>`_
|
||||
for the syntax. Example::
|
||||
|
||||
dburi: 'mysql://nodepool@localhost/nodepool'
|
||||
dburi: 'mysql+pymysql://nodepool@localhost/nodepool'
|
||||
|
||||
cron
|
||||
----
|
||||
|
@ -16,8 +16,8 @@
|
||||
"""Common utilities used in testing"""
|
||||
|
||||
import logging
|
||||
import MySQLdb
|
||||
import os
|
||||
import pymysql
|
||||
import random
|
||||
import string
|
||||
import subprocess
|
||||
@ -145,7 +145,7 @@ class MySQLSchemaFixture(fixtures.Fixture):
|
||||
string.ascii_uppercase)
|
||||
for x in range(8))
|
||||
self.name = '%s_%s' % (random_bits, os.getpid())
|
||||
db = MySQLdb.connect(host="localhost",
|
||||
db = pymysql.connect(host="localhost",
|
||||
user="openstack_citest",
|
||||
passwd="openstack_citest",
|
||||
db="openstack_citest")
|
||||
@ -155,12 +155,12 @@ class MySQLSchemaFixture(fixtures.Fixture):
|
||||
(self.name, self.name))
|
||||
cur.execute("flush privileges")
|
||||
|
||||
self.dburi = 'mysql://%s@localhost/%s' % (self.name, self.name)
|
||||
self.dburi = 'mysql+pymysql://%s@localhost/%s' % (self.name, self.name)
|
||||
self.addDetail('dburi', testtools.content.text_content(self.dburi))
|
||||
self.addCleanup(self.cleanup)
|
||||
|
||||
def cleanup(self):
|
||||
db = MySQLdb.connect(host="localhost",
|
||||
db = pymysql.connect(host="localhost",
|
||||
user="openstack_citest",
|
||||
passwd="openstack_citest",
|
||||
db="openstack_citest")
|
||||
|
@ -1,7 +1,7 @@
|
||||
script-dir: /etc/nodepool/scripts
|
||||
elements-dir: /etc/nodepool/elements
|
||||
images-dir: /opt/nodepool_dib
|
||||
dburi: 'mysql://nodepool:<%= mysql_password %>@localhost/nodepool'
|
||||
dburi: 'mysql+pymysql://nodepool:<%= mysql_password %>@localhost/nodepool'
|
||||
|
||||
cron:
|
||||
cleanup: '*/1 * * * *'
|
||||
@ -1067,4 +1067,4 @@ diskimages:
|
||||
DIB_IMAGE_CACHE: /opt/dib_cache
|
||||
DIB_CLOUD_IMAGES: https://download.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.qcow2
|
||||
BASE_IMAGE_FILE: Fedora-Cloud-Base-20141203-21.x86_64.qcow2
|
||||
QEMU_IMG_OPTIONS: compat=0.10
|
||||
QEMU_IMG_OPTIONS: compat=0.10
|
||||
|
@ -1,6 +1,6 @@
|
||||
script-dir: /etc/nodepool/scripts
|
||||
elements-dir: /etc/nodepool/elements
|
||||
images-dir: /opt/nodepool_dib
|
||||
dburi: 'mysql://nodepool:<%= mysql_password %>@localhost/nodepool'
|
||||
dburi: 'mysql+pymysql://nodepool:<%= mysql_password %>@localhost/nodepool'
|
||||
|
||||
nothandled: element
|
||||
nothandled: element
|
||||
|
@ -1,7 +1,7 @@
|
||||
script-dir: /etc/nodepool/scripts
|
||||
elements-dir: /etc/nodepool/elements
|
||||
images-dir: /opt/nodepool_dib
|
||||
dburi: 'mysql://nodepool:<%= mysql_password %>@localhost/nodepool'
|
||||
dburi: 'mysql+pymysql://nodepool:<%= mysql_password %>@localhost/nodepool'
|
||||
|
||||
cron:
|
||||
cleanup: '*/1 * * * *'
|
||||
@ -1067,4 +1067,4 @@ diskimages:
|
||||
DIB_IMAGE_CACHE: /opt/dib_cache
|
||||
DIB_CLOUD_IMAGES: https://download.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.qcow2
|
||||
BASE_IMAGE_FILE: Fedora-Cloud-Base-20141203-21.x86_64.qcow2
|
||||
QEMU_IMG_OPTIONS: compat=0.10
|
||||
QEMU_IMG_OPTIONS: compat=0.10
|
||||
|
@ -13,7 +13,7 @@ pyzmq>=13.1.0,<14.0.0
|
||||
python-glanceclient
|
||||
python-keystoneclient
|
||||
python-novaclient
|
||||
MySQL-python
|
||||
PyMySQL
|
||||
PrettyTable>=0.6,<0.8
|
||||
six>=1.7.0
|
||||
diskimage-builder
|
||||
|
@ -1,7 +1,7 @@
|
||||
script-dir: .
|
||||
elements-dir: .
|
||||
images-dir: /tmp/nodepool_dib
|
||||
dburi: 'mysql://nodepool@localhost/nodepool'
|
||||
dburi: 'mysql+pymysql://nodepool@localhost/nodepool'
|
||||
|
||||
cron:
|
||||
check: '*/15 * * * *'
|
||||
|
@ -1,5 +1,5 @@
|
||||
script-dir: .
|
||||
dburi: 'mysql://nodepool@localhost/nodepool'
|
||||
dburi: 'mysql+pymysql://nodepool@localhost/nodepool'
|
||||
|
||||
cron:
|
||||
check: '*/15 * * * *'
|
||||
|
Loading…
x
Reference in New Issue
Block a user