changeset 2693:59ea85d47d34

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.
author Alexander Smishlajev <a1s@users.sourceforge.net>
date Sun, 26 Sep 2004 15:16:02 +0000
parents f1c9873496f0
children 91fdaaf8d929
files roundup/backends/back_mysql.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/backends/back_mysql.py	Sun Sep 26 14:38:54 2004 +0000
+++ b/roundup/backends/back_mysql.py	Sun Sep 26 15:16:02 2004 +0000
@@ -39,8 +39,8 @@
 import os, shutil
 from MySQLdb.constants import ER
 
-def connection_dict(config):
-    d = rdbms_common.connection_dict(config, 'db')
+def connection_dict(config, dbnamestr=None):
+    d = rdbms_common.connection_dict(config, dbnamestr)
     if d.has_key('password'):
         d['passwd'] = d['password']
         del d['password']
@@ -132,7 +132,7 @@
     }
 
     def sql_open_connection(self):
-        kwargs = connection_dict(self.config)
+        kwargs = connection_dict(self.config, 'db')
         self.config.logging.getLogger('hyperdb').info('open database %r'%(
             kwargs['db'],))
         try:

Roundup Issue Tracker: http://roundup-tracker.org/