server/serverctl.py
changeset 10237 1e030b1a5622
parent 10236 ef3059a692cb
child 10354 635cfac73d28
equal deleted inserted replaced
10236:ef3059a692cb 10237:1e030b1a5622
   292                     if ASK.confirm('An error occurred. Continue anyway?',
   292                     if ASK.confirm('An error occurred. Continue anyway?',
   293                                    default_is_yes=False):
   293                                    default_is_yes=False):
   294                         continue
   294                         continue
   295                     raise ExecutionError(str(exc))
   295                     raise ExecutionError(str(exc))
   296 
   296 
   297 
       
   298 class RepositoryStartHandler(CommandHandler):
       
   299     cmdname = 'start'
       
   300     cfgname = 'repository'
       
   301 
       
   302     def start_server(self, config):
       
   303         command = ['cubicweb-ctl', 'start-repository']
       
   304         if config.debugmode:
       
   305             command.append('--debug')
       
   306         command.append('--loglevel')
       
   307         command.append(config['log-threshold'].lower())
       
   308         command.append(config.appid)
       
   309         subprocess.call(command)
       
   310         return 1
       
   311 
       
   312 
       
   313 class RepositoryStopHandler(CommandHandler):
       
   314     cmdname = 'stop'
       
   315     cfgname = 'repository'
       
   316 
       
   317     def poststop(self):
       
   318         pass
       
   319 
   297 
   320 # repository specific commands ################################################
   298 # repository specific commands ################################################
   321 
   299 
   322 def createdb(helper, source, dbcnx, cursor, **kwargs):
   300 def createdb(helper, source, dbcnx, cursor, **kwargs):
   323     if dbcnx.logged_user != source['db-user']:
   301     if dbcnx.logged_user != source['db-user']: