Skip to content

Commit 3aa9164

Browse files
author
Alexander Smishlajev
committed
add dbnamestr argument to connection_dict...
...passed to rdbms_common.connection_dict instead of hard-coded 'db'. this allows maintenance procedures (db_nuke, db_create, db_exists) to connect without specifying roundup database name: these functions must not require existing roundup database.
1 parent 5d53f6e commit 3aa9164

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

roundup/backends/back_mysql.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
import os, shutil
4040
from MySQLdb.constants import ER
4141

42-
def connection_dict(config):
43-
d = rdbms_common.connection_dict(config, 'db')
42+
def connection_dict(config, dbnamestr=None):
43+
d = rdbms_common.connection_dict(config, dbnamestr)
4444
if d.has_key('password'):
4545
d['passwd'] = d['password']
4646
del d['password']
@@ -132,7 +132,7 @@ class Database(Database):
132132
}
133133

134134
def sql_open_connection(self):
135-
kwargs = connection_dict(self.config)
135+
kwargs = connection_dict(self.config, 'db')
136136
self.config.logging.getLogger('hyperdb').info('open database %r'%(
137137
kwargs['db'],))
138138
try:

0 commit comments

Comments
 (0)