def action_run(params): from nailgun.settings import settings settings.update({ 'LISTEN_PORT': int(params.port), 'LISTEN_ADDRESS': params.address, }) for attr in ['FAKE_TASKS', 'FAKE_TASKS_TICK_COUNT', 'FAKE_TASKS_TICK_INTERVAL', 'FAKE_TASKS_AMQP']: param = getattr(params, attr.lower()) if param is not None: settings.update({attr: param}) if params.config_file: settings.update_from_file(params.config_file) from nailgun.app import appstart appstart()
def action_run(params): from nailgun.settings import settings settings.update({"LISTEN_PORT": int(params.port), "LISTEN_ADDRESS": params.address}) for attr in ["FAKE_TASKS", "FAKE_TASKS_TICK_COUNT", "FAKE_TASKS_TICK_INTERVAL", "FAKE_TASKS_AMQP"]: param = getattr(params, attr.lower()) if param is not None: settings.update({attr: param}) if params.authentication_method: auth_method = params.authentication_method settings.AUTH.update({"AUTHENTICATION_METHOD": auth_method}) if params.config_file: settings.update_from_file(params.config_file) from nailgun.app import appstart appstart()
def action_run(params): from nailgun.settings import settings #并入参数中的配置 settings.update({ 'LISTEN_PORT': int(params.port), 'LISTEN_ADDRESS': params.address, }) for attr in ['FAKE_TASKS', 'FAKE_TASKS_TICK_COUNT', 'FAKE_TASKS_TICK_INTERVAL', 'FAKE_TASKS_AMQP']: param = getattr(params, attr.lower()) if param is not None: settings.update({attr: param}) if params.authentication_method: auth_method = params.authentication_method settings.AUTH.update({'AUTHENTICATION_METHOD': auth_method}) #如果参数中指定了配置文件,则也将其加入 if params.config_file: settings.update_from_file(params.config_file) from nailgun.app import appstart #app启动 appstart()