server/serverctl.py
branchstable
changeset 7815 2a164a9cf81c
parent 7764 c709f6c457ff
child 8233 9b9180969892
equal deleted inserted replaced
7814:1ec9fe1dfba9 7815:2a164a9cf81c
   246                     if confirm_on_error_or_die(
   246                     if confirm_on_error_or_die(
   247                         'dropping user %s' % user,
   247                         'dropping user %s' % user,
   248                         cursor.execute, 'DROP USER %s' % user) is not ERROR:
   248                         cursor.execute, 'DROP USER %s' % user) is not ERROR:
   249                         print '-> user %s dropped.' % user
   249                         print '-> user %s dropped.' % user
   250                 cnx.commit()
   250                 cnx.commit()
   251             except:
   251             except BaseException:
   252                 cnx.rollback()
   252                 cnx.rollback()
   253                 raise
   253                 raise
   254 
   254 
   255 
   255 
   256 class RepositoryStartHandler(CommandHandler):
   256 class RepositoryStartHandler(CommandHandler):
   361                                '--drop %s" manually to continue.' % config.appid)
   361                                '--drop %s" manually to continue.' % config.appid)
   362                         return
   362                         return
   363                 createdb(helper, source, dbcnx, cursor)
   363                 createdb(helper, source, dbcnx, cursor)
   364                 dbcnx.commit()
   364                 dbcnx.commit()
   365                 print '-> database %s created.' % dbname
   365                 print '-> database %s created.' % dbname
   366             except:
   366             except BaseException:
   367                 dbcnx.rollback()
   367                 dbcnx.rollback()
   368                 raise
   368                 raise
   369         cnx = system_source_cnx(source, special_privs='CREATE LANGUAGE',
   369         cnx = system_source_cnx(source, special_privs='CREATE LANGUAGE',
   370                                 interactive=not automatic)
   370                                 interactive=not automatic)
   371         cursor = cnx.cursor()
   371         cursor = cnx.cursor()