Switch from MySQL-python to PyMySQL
For the same reason nodepool switched[1], let's switch jeepyb too.
[1] http://git.openstack.org/cgit/openstack-infra/nodepool/commit/?id=63e5297f7e56bd2f8ca8c16e1f1b032f6c6f5ab8
Change-Id: I3afeaebeb8416388d5866fc3994357935079c97d
diff --git a/jeepyb/cmd/update_blueprint.py b/jeepyb/cmd/update_blueprint.py
index 1cff559..0d2d729 100644
--- a/jeepyb/cmd/update_blueprint.py
+++ b/jeepyb/cmd/update_blueprint.py
@@ -26,7 +26,7 @@
from launchpadlib import launchpad
from launchpadlib import uris
-import MySQLdb
+import PyMySQL
from jeepyb import projects as p
@@ -154,8 +154,8 @@
'Gerrit User Sync', uris.LPNET_SERVICE_ROOT, GERRIT_CACHE_DIR,
credentials_file=GERRIT_CREDENTIALS, version='devel')
- conn = MySQLdb.connect(
- host=DB_HOST, user=DB_USER, passwd=DB_PASS, db=DB_DB)
+ conn = PyMySQL.connect(
+ host=DB_HOST, user=DB_USER, password=DB_PASS, db=DB_DB)
find_specs(lpconn, conn, args)
diff --git a/jeepyb/gerritdb.py b/jeepyb/gerritdb.py
index 3f5db66..32ce3d9 100644
--- a/jeepyb/gerritdb.py
+++ b/jeepyb/gerritdb.py
@@ -53,9 +53,9 @@
DB_DB = gerrit_config.get("database", "database")
if DB_TYPE.upper() == "MYSQL":
- import MySQLdb
- db_connection = MySQLdb.connect(
- host=DB_HOST, user=DB_USER, passwd=DB_PASS, db=DB_DB)
+ import PyMySQL
+ db_connection = PyMySQL.connect(
+ host=DB_HOST, user=DB_USER, password=DB_PASS, db=DB_DB)
else:
import psycopg2
db_connection = psycopg2.connect(
diff --git a/requirements.txt b/requirements.txt
index 65d5218..9390472 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,7 +2,7 @@
argparse
gerritlib>=0.3.0
-MySQL-python
+PyMySQL
paramiko
PyGithub
pyyaml