Пример #1
0
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.wsgi import appstart
    appstart(keepalive=params.keepalive)
Пример #2
0
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.wsgi import appstart
    appstart()
Пример #3
0
        fixman.upload_fixtures()
        logger.info("Done")
    elif params.action == "dump_settings":
        sys.stdout.write(settings.dump())
    elif params.action in ("run",):
        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.wsgi import appstart
        appstart(keepalive=params.keepalive)
    elif params.action == "shell":
        from nailgun.db import db
        if params.config_file:
            settings.update_from_file(params.config_file)
        try:
            from IPython import embed
            embed()
        except ImportError:
            code.interact(local={'orm': orm, 'settings': settings})
        db().commit()
    else:
        parser.print_help()
Пример #4
0
        logger.info("Done")
    elif params.action == "dump_settings":
        sys.stdout.write(settings.dump())
    elif params.action in ("run", ):
        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.wsgi import appstart
        appstart(keepalive=params.keepalive)
    elif params.action == "shell":
        from nailgun.db import db
        if params.config_file:
            settings.update_from_file(params.config_file)
        try:
            from IPython import embed
            embed()
        except ImportError:
            code.interact(local={'db': db, 'settings': settings})
    else:
        parser.print_help()