示例#1
0
文件: base.py 项目: openstack/tacker
 def config_parse(conf=None, args=None):
     """Create the default configurations."""
     # tacker.conf.test includes rpc_backend which needs to be cleaned up
     if args is None:
         args = ['--config-file', etcdir('tacker.conf.test')]
     if conf is None:
         config.init(args=args)
     else:
         conf(args)
示例#2
0
文件: base.py 项目: vutuong/tacker
 def config_parse(conf=None, args=None):
     """Create the default configurations."""
     # tacker.conf.test includes rpc_backend which needs to be cleaned up
     if args is None:
         args = ['--config-file', etcdir('tacker.conf.test')]
     if conf is None:
         config.init(args=args)
     else:
         conf(args)
示例#3
0
文件: server.py 项目: DorChen/tacker
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)
示例#4
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)