1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
From: Sandro Tosi <morph@debian.org>
Date: Mon, 11 Jun 2018 11:06:56 -0400
Subject: support_alternative_mysqld_implementation
---
mysql-connector-python/tests/mysqld.py | 6 +++---
mysqlx-connector-python/tests/mysqld.py | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/mysql-connector-python/tests/mysqld.py b/mysql-connector-python/tests/mysqld.py
index ff0233d..f5e7297 100644
--- a/mysql-connector-python/tests/mysqld.py
+++ b/mysql-connector-python/tests/mysqld.py
@@ -188,14 +188,14 @@ class MySQLServerBase:
if self._sbindir:
break
for afile in files:
- if afile == EXEC_MYSQLD and os.access(os.path.join(root, afile), 0):
+ if afile == EXEC_MYSQLD and 'bin' in root and os.access(os.path.join(root, afile), 0):
self._sbindir = root
LOGGER.debug("Located {} in {}".format(EXEC_MYSQLD, self._sbindir))
try:
files_to_find.remove(EXEC_MYSQLD)
except ValueError:
pass
- elif afile == EXEC_MYSQL and os.access(os.path.join(root, afile), 0):
+ elif afile == EXEC_MYSQL and 'bin' in root and os.access(os.path.join(root, afile), 0):
self._bindir = root
LOGGER.debug("Located {} in {}".format(EXEC_MYSQL, self._bindir))
try:
@@ -299,7 +299,7 @@ class MySQLServerBase:
prc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
verstr = str(prc.communicate()[0])
- matches = re.match(r".*Ver (\d)\.(\d).(\d{1,2})-*(\S*).*", verstr)
+ matches = re.match(r".*Ver (\d{1,2})\.(\d).(\d{1,2})-*(\S*).*", verstr)
if matches:
matches_groups = matches.groups()
ver = tuple([int(v) for v in matches_groups[0:-1]])
diff --git a/mysqlx-connector-python/tests/mysqld.py b/mysqlx-connector-python/tests/mysqld.py
index ff0233d..f5e7297 100644
--- a/mysqlx-connector-python/tests/mysqld.py
+++ b/mysqlx-connector-python/tests/mysqld.py
@@ -188,14 +188,14 @@ class MySQLServerBase:
if self._sbindir:
break
for afile in files:
- if afile == EXEC_MYSQLD and os.access(os.path.join(root, afile), 0):
+ if afile == EXEC_MYSQLD and 'bin' in root and os.access(os.path.join(root, afile), 0):
self._sbindir = root
LOGGER.debug("Located {} in {}".format(EXEC_MYSQLD, self._sbindir))
try:
files_to_find.remove(EXEC_MYSQLD)
except ValueError:
pass
- elif afile == EXEC_MYSQL and os.access(os.path.join(root, afile), 0):
+ elif afile == EXEC_MYSQL and 'bin' in root and os.access(os.path.join(root, afile), 0):
self._bindir = root
LOGGER.debug("Located {} in {}".format(EXEC_MYSQL, self._bindir))
try:
@@ -299,7 +299,7 @@ class MySQLServerBase:
prc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
verstr = str(prc.communicate()[0])
- matches = re.match(r".*Ver (\d)\.(\d).(\d{1,2})-*(\S*).*", verstr)
+ matches = re.match(r".*Ver (\d{1,2})\.(\d).(\d{1,2})-*(\S*).*", verstr)
if matches:
matches_groups = matches.groups()
ver = tuple([int(v) for v in matches_groups[0:-1]])
|