Exemplo n.º 1
0
Arquivo: wsgi.py Projeto: kjylmr/guts
def initialize_application():
    objects.register_all()
    CONF(sys.argv[1:], project='guts', version=version.version_string())
    logging.setup(CONF, "guts")

    rpc.init(CONF)
    return wsgi_common.Loader().load_app(name='osapi_migration')
Exemplo n.º 2
0
Arquivo: all.py Projeto: kjylmr/guts
def main():
    objects.register_all()
    CONF(sys.argv[1:], project='guts',
         version=version.version_string())
    logging.setup(CONF, "guts")
    LOG = logging.getLogger('guts.all')

    utils.monkey_patch()

    gmr.TextGuruMeditation.setup_autorun(version)

    rpc.init(CONF)

    launcher = service.process_launcher()
    # guts-api
    try:
        server = service.WSGIService('osapi_migration')
        launcher.launch_service(server, workers=server.workers or 1)
    except (Exception, SystemExit):
        LOG.exception(_LE('Failed to load osapi_migration'))

    # guts-migration
    try:
        launcher.launch_service(
            service.Service.create(binary='guts-migration'))
    except (Exception, SystemExit):
        LOG.exception(_LE('Failed to load guts-migration'))

    launcher.wait()
Exemplo n.º 3
0
    def __init__(self, host, binary, topic, manager, report_interval=None,
                 periodic_interval=None, periodic_fuzzy_delay=None,
                 service_name=None, *args, **kwargs):
        super(Service, self).__init__()

        if not rpc.initialized():
            rpc.init(CONF)

        self.host = host
        self.binary = binary
        self.topic = topic
        self.manager_class_name = manager
        manager_class = importutils.import_class(self.manager_class_name)
        manager_class = profiler.trace_cls("rpc")(manager_class)

        self.manager = manager_class(host=self.host,
                                     service_name=service_name,
                                     *args, **kwargs)
        self.report_interval = report_interval
        self.periodic_interval = periodic_interval
        self.periodic_fuzzy_delay = periodic_fuzzy_delay
        self.basic_config_check()
        self.saved_args, self.saved_kwargs = args, kwargs
        self.timers = []

        setup_profiler(binary, host)
        self.rpcserver = None
Exemplo n.º 4
0
def initialize_application():
    objects.register_all()
    CONF(sys.argv[1:], project='guts',
         version=version.version_string())
    logging.setup(CONF, "guts")

    rpc.init(CONF)
    return wsgi_common.Loader().load_app(name='osapi_migration')
Exemplo n.º 5
0
Arquivo: api.py Projeto: kjylmr/guts
def main():
    objects.register_all()
    CONF(sys.argv[1:], project='guts', version=version.version_string())
    logging.setup(CONF, "guts")
    utils.monkey_patch()

    rpc.init(CONF)
    launcher = service.process_launcher()
    server = service.WSGIService('osapi_migration')
    launcher.launch_service(server, workers=server.workers)
    launcher.wait()
Exemplo n.º 6
0
Arquivo: api.py Projeto: aptira/guts
def main():
    objects.register_all()
    CONF(sys.argv[1:], project="guts", version=version.version_string())
    logging.setup(CONF, "guts")
    utils.monkey_patch()

    rpc.init(CONF)
    launcher = service.process_launcher()
    server = service.WSGIService("osapi_migration")
    launcher.launch_service(server, workers=server.workers)
    launcher.wait()
Exemplo n.º 7
0
    def __init__(self,
                 host,
                 binary,
                 topic,
                 manager,
                 report_interval=None,
                 periodic_interval=None,
                 periodic_fuzzy_delay=None,
                 service_name=None,
                 *args,
                 **kwargs):
        super(Service, self).__init__()

        if not rpc.initialized():
            rpc.init(CONF)

        self.host = host
        self.binary = binary
        self.topic = topic
        self.manager_class_name = manager
        manager_class = importutils.import_class(self.manager_class_name)
        manager_class = profiler.trace_cls("rpc")(manager_class)

        self.manager = manager_class(host=self.host,
                                     service_name=service_name,
                                     *args,
                                     **kwargs)
        self.report_interval = report_interval
        self.periodic_interval = periodic_interval
        self.periodic_fuzzy_delay = periodic_fuzzy_delay
        self.basic_config_check()
        self.saved_args, self.saved_kwargs = args, kwargs
        self.timers = []

        setup_profiler(binary, host)
        self.rpcserver = None