server/serverctl.py
branchstable
changeset 4218 deb2dcffb301
parent 4212 ab6573088b4a
child 4252 6c4f109c2b03
--- a/server/serverctl.py	Fri Jan 08 18:20:03 2010 +0100
+++ b/server/serverctl.py	Sat Jan 09 15:31:37 2010 +0100
@@ -30,11 +30,15 @@
     """
     from getpass import getpass
     from logilab.common.db import get_connection
-    dbhost = source['db-host']
+    dbhost = source.get('db-host')
     if dbname is None:
         dbname = source['db-name']
     driver = source['db-driver']
-    print '-> connecting to %s database %s@%s' % (driver, dbname, dbhost or 'localhost'),
+    print '-> connecting to %s database' % driver,
+    if dbhost:
+        print '%s@%s' % (dbname, dbhost),
+    else:
+        print dbname,
     if not verbose or (not special_privs and source.get('db-user')):
         user = source['db-user']
         print 'as', user