Example #1
0
def main():
    conf = cfg.CONF

    # NOTE(yamahata): work around. rpc driver-dependent config variables
    # remove this line once tacker are fully ported to oslo.messaging
    from tacker.openstack.common import rpc
    conf.unregister_opts(rpc.rpc_opts)

    # NOTE(yamahata): corresponds to
    # tacker.common.config.rpc.set_default(control_exchange='tacker')
    messaging.set_transport_defaults('tacker')

    _register_options(conf)
    conf(project='tacker')
    config.setup_logging(conf)
    legacy.modernize_quantum_config(conf)
    # NOTE(yamahata): workaround for state_path
    #                 oslo.messaging doesn't know state_path
    conf.set_override('rpc_unix_ipc_dir', conf.svcvm_proxy_dir)

    server = oslo_service.TackerService.create(
        topic=topics.SERVICEVM_AGENT,
        manager='tacker.vm.agent.agent.ServiceVMAgentWithStateReport',
        report_interval=conf.AGENT.report_interval,
        conf=conf)
    service.launch(server).wait()
Example #2
0
def main():
    conf = cfg.CONF

    # NOTE(yamahata): work around. rpc driver-dependent config variables
    # remove this line once tacker are fully ported to oslo.messaging
    from tacker.openstack.common import rpc

    conf.unregister_opts(rpc.rpc_opts)

    # NOTE(yamahata): corresponds to
    # tacker.common.config.rpc.set_default(control_exchange='tacker')
    messaging.set_transport_defaults("tacker")

    _register_options(conf)
    conf(project="tacker")
    config.setup_logging(conf)
    legacy.modernize_quantum_config(conf)
    # NOTE(yamahata): workaround for state_path
    #                 oslo.messaging doesn't know state_path
    conf.set_override("rpc_unix_ipc_dir", conf.svcvm_proxy_dir)

    server = oslo_service.TackerService.create(
        topic=topics.SERVICEVM_AGENT,
        manager="tacker.vm.agent.agent.ServiceVMAgentWithStateReport",
        report_interval=conf.AGENT.report_interval,
        conf=conf,
    )
    service.launch(server).wait()
    def run(self):
        conf = self._conf

        def server_stop():
            server.stop()
        LOG.debug(_('src transport url %s'), conf.src_transport_url)
        src_transport = messaging.get_transport(
            conf, conf.src_transport_url,
            aliases=oslo_service.TRANSPORT_ALIASES)
        server = Service.create(
            conf=conf, topic=topics.SERVICEVM_AGENT_NAMEPSACE,
            manager_=('tacker.vm.agent.namespace_proxy.'
                      'ServiceVMNamespaceAgent'),
            src_transport=src_transport, server_stop=server_stop)
        service.launch(server).wait()
        src_transport.cleanup()
Example #4
0
    def run(self):
        conf = self._conf

        def server_stop():
            server.stop()

        LOG.debug(_('src transport url %s'), conf.src_transport_url)
        src_transport = messaging.get_transport(
            conf,
            conf.src_transport_url,
            aliases=oslo_service.TRANSPORT_ALIASES)
        server = Service.create(conf=conf,
                                topic=topics.SERVICEVM_AGENT_NAMEPSACE,
                                manager_=('tacker.vm.agent.namespace_proxy.'
                                          'ServiceVMNamespaceAgent'),
                                src_transport=src_transport,
                                server_stop=server_stop)
        service.launch(server).wait()
        src_transport.cleanup()
Example #5
0
def main():
    # the configuration will be read into the cfg.CONF global data structure
    config.init(sys.argv[1:])
    if not cfg.CONF.config_file:
        sys.exit(_("ERROR: Unable to find configuration file via the default"
                   " search paths (~/.tacker/, ~/, /etc/tacker/, /etc/) and"
                   " the '--config-file' option!"))

    try:
        tacker_api = service.serve_wsgi(service.TackerApiService)
        launcher = common_service.launch(tacker_api,
                                         workers=cfg.CONF.api_workers)
        launcher.wait()
    except KeyboardInterrupt:
        pass
    except RuntimeError as e:
        sys.exit(_("ERROR: %s") % e)
Example #6
0
def main():
    # the configuration will be read into the cfg.CONF global data structure
    config.init(sys.argv[1:])
    if not cfg.CONF.config_file:
        sys.exit(
            _("ERROR: Unable to find configuration file via the default"
              " search paths (~/.tacker/, ~/, /etc/tacker/, /etc/) and"
              " the '--config-file' option!"))

    try:
        tacker_api = service.serve_wsgi(service.TackerApiService)
        launcher = common_service.launch(tacker_api,
                                         workers=cfg.CONF.api_workers)
        launcher.wait()
    except KeyboardInterrupt:
        pass
    except RuntimeError as e:
        sys.exit(_("ERROR: %s") % e)