Commit 74ec44e3 authored by Julien Muchembled's avatar Julien Muchembled

mysql: make 'user' actually optional in the DB connection string

parent 87c1de3b
...@@ -117,9 +117,11 @@ class MySQLDatabaseManager(DatabaseManager): ...@@ -117,9 +117,11 @@ class MySQLDatabaseManager(DatabaseManager):
return super(MySQLDatabaseManager, self).__getattr__(attr) return super(MySQLDatabaseManager, self).__getattr__(attr)
def _tryConnect(self): def _tryConnect(self):
kwd = {'db' : self.db, 'user' : self.user} kwd = {'db' : self.db}
if self.passwd is not None: if self.user:
kwd['passwd'] = self.passwd kwd['user'] = self.user
if self.passwd is not None:
kwd['passwd'] = self.passwd
if self.socket: if self.socket:
kwd['unix_socket'] = os.path.expanduser(self.socket) kwd['unix_socket'] = os.path.expanduser(self.socket)
logging.info('connecting to MySQL on the database %s with user %s', logging.info('connecting to MySQL on the database %s with user %s',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment