more extra_args cleanup stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 22 Dec 2009 14:18:48 +0100
branchstable
changeset 4180 9fb0d06926cc
parent 4179 3a0b2f14e17b
child 4185 ed99de8f93f2
more extra_args cleanup
server/serverctl.py
--- a/server/serverctl.py	Tue Dec 22 13:43:24 2009 +0100
+++ b/server/serverctl.py	Tue Dec 22 14:18:48 2009 +0100
@@ -56,9 +56,11 @@
             password = source['db-password']
         else:
             password = getpass('password: ')
+    extra_args = source.get('db-extra-arguments')
+    extra = extra_args and {'extra_args': extra_args} or {}
     return get_connection(driver, dbhost, dbname, user, password=password,
                           port=source.get('db-port'),
-                          extra_args=source.get('db-extra-arguments'))
+                          **extra)
 
 def system_source_cnx(source, dbms_system_base=False,
                       special_privs='CREATE/DROP DATABASE', verbose=True):
@@ -366,11 +368,13 @@
         config = ServerConfiguration.config_for(appid)
         try:
             system = config.sources()['system']
+            extra_args=system.get('db-extra-arguments')
+            extra = extra_args and {'extra_args': extra_args} or {}
             get_connection(
                 system['db-driver'], database=system['db-name'],
                 host=system.get('db-host'), port=system.get('db-port'),
                 user=system.get('db-user'), password=system.get('db-password'), 
-                extra_args=system.get('db-extra-arguments'))
+                **extra)
         except Exception, ex:
             raise ConfigurationError(
                 'You seem to have provided wrong connection information in '\