server/serverctl.py
changeset 7569 02c338197322
parent 7479 b0603fc4ed6d
parent 7564 1d64c8d33156
child 7577 9892937d9041
equal deleted inserted replaced
7565:b355d9dd43df 7569:02c338197322
   354                            ASK.confirm('Create db user %s ?' % user, default_is_yes=False)):
   354                            ASK.confirm('Create db user %s ?' % user, default_is_yes=False)):
   355                         helper.create_user(source['db-user'], source.get('db-password'))
   355                         helper.create_user(source['db-user'], source.get('db-password'))
   356                         print '-> user %s created.' % user
   356                         print '-> user %s created.' % user
   357                 if dbname in helper.list_databases(cursor):
   357                 if dbname in helper.list_databases(cursor):
   358                     if automatic or ASK.confirm('Database %s already exists -- do you want to drop it ?' % dbname):
   358                     if automatic or ASK.confirm('Database %s already exists -- do you want to drop it ?' % dbname):
   359                         cursor.execute('DROP DATABASE %s' % dbname)
   359                         cursor.execute('DROP DATABASE "%s"' % dbname)
   360                     else:
   360                     else:
   361                         print ('you may want to run "cubicweb-ctl db-init '
   361                         print ('you may want to run "cubicweb-ctl db-init '
   362                                '--drop %s" manually to continue.' % config.appid)
   362                                '--drop %s" manually to continue.' % config.appid)
   363                         return
   363                         return
   364                 createdb(helper, source, dbcnx, cursor)
   364                 createdb(helper, source, dbcnx, cursor)