cwctl.py
changeset 10474 1dcc52f5e340
parent 10321 a4af502191d5
child 10569 af47954c1015
equal deleted inserted replaced
10473:23a2fa8cb725 10474:1dcc52f5e340
   518         ('loglevel',
   518         ('loglevel',
   519          {'short': 'l', 'type' : 'choice', 'metavar': '<log level>',
   519          {'short': 'l', 'type' : 'choice', 'metavar': '<log level>',
   520           'default': None, 'choices': ('debug', 'info', 'warning', 'error'),
   520           'default': None, 'choices': ('debug', 'info', 'warning', 'error'),
   521           'help': 'debug if -D is set, error otherwise',
   521           'help': 'debug if -D is set, error otherwise',
   522           }),
   522           }),
   523         )
   523         ('param',
       
   524          {'short': 'p', 'type' : 'named', 'metavar' : 'key1:value1,key2:value2',
       
   525           'default': {},
       
   526           'help': 'override <key> configuration file option with <value>.',
       
   527          }),
       
   528        )
   524 
   529 
   525     def start_instance(self, appid):
   530     def start_instance(self, appid):
   526         """start the instance's server"""
   531         """start the instance's server"""
   527         try:
   532         try:
   528             import twisted  # noqa
   533             import twisted  # noqa
   532                 "Either install it, or use one of the alternative commands:\n"
   537                 "Either install it, or use one of the alternative commands:\n"
   533                 "- '{ctl} wsgi {appid}'\n"
   538                 "- '{ctl} wsgi {appid}'\n"
   534                 "- '{ctl} pyramid {appid}' (requires the pyramid cube)\n")
   539                 "- '{ctl} pyramid {appid}' (requires the pyramid cube)\n")
   535             raise ExecutionError(msg.format(ctl='cubicweb-ctl', appid=appid))
   540             raise ExecutionError(msg.format(ctl='cubicweb-ctl', appid=appid))
   536         config = cwcfg.config_for(appid, debugmode=self['debug'])
   541         config = cwcfg.config_for(appid, debugmode=self['debug'])
       
   542         # override config file values with cmdline options
       
   543         config.cmdline_options = self.config.param
   537         init_cmdline_log_threshold(config, self['loglevel'])
   544         init_cmdline_log_threshold(config, self['loglevel'])
   538         if self['profile']:
   545         if self['profile']:
   539             config.global_set_option('profile', self.config.profile)
   546             config.global_set_option('profile', self.config.profile)
   540         helper = self.config_helper(config, cmdname='start')
   547         helper = self.config_helper(config, cmdname='start')
   541         pidf = config['pid-file']
   548         pidf = config['pid-file']