Merge branch 'master' into production
This commit is contained in:
commit
1b5c75c57c
|
@ -20,6 +20,7 @@ import datetime
|
|||
from collections import OrderedDict
|
||||
from random import uniform
|
||||
import sys
|
||||
import configparser
|
||||
|
||||
import MySQLdb
|
||||
import _mysql_exceptions
|
||||
|
@ -42,6 +43,23 @@ class MysqlBackend:
|
|||
self.db = None
|
||||
self.cursor = None
|
||||
|
||||
# For more info, see https://jira.mariadb.org/browse/CONC-359
|
||||
self._fix_missing_host(self.dbargs)
|
||||
|
||||
def _fix_missing_host(self, dbargs):
|
||||
if "host" in dbargs:
|
||||
return
|
||||
|
||||
if "read_default_file" not in dbargs:
|
||||
return
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
config.read(dbargs["read_default_file"])
|
||||
if "host" not in config["client"]:
|
||||
return
|
||||
dbargs["host"] = config["client"]["host"]
|
||||
|
||||
|
||||
def __enter__(self):
|
||||
# We open a connection once we actually need it
|
||||
return self
|
||||
|
|
Loading…
Reference in New Issue