def _init_configuration(): # the configuration will be read into the cfg.CONF global data structure config.init(sys.argv[1:]) config.setup_logging() config.set_config_defaults() if not cfg.CONF.config_file: sys.exit(_("ERROR: Unable to find configuration file via the default" " search paths (~/.neutron/, ~/, /etc/neutron/, /etc/) and" " the '--config-file' option!"))
def _init_configuration(): # the configuration will be read into the cfg.CONF global data structure config.init(sys.argv[1:]) #初始化CONF,初始化rpc、notification、检验CONF.base_mac config.setup_logging() #log相关 config.set_config_defaults() #wsgi_middleware cors相关 if not cfg.CONF.config_file: sys.exit( _("ERROR: Unable to find configuration file via the default" " search paths (~/.neutron/, ~/, /etc/neutron/, /etc/) and" " the '--config-file' option!"))
def main(): config.init(sys.argv[1:]) config.setup_logging() config.set_config_defaults() if not cfg.CONF.config_file: sys.exit(_("ERROR: Unable to find configuration file via the default" " search paths (~/.neutron/, ~/, /etc/neutron/, /etc/) and" " the '--config-file' option!")) client = QuarkRpcTestApi(TEST_TOPIC) LOG.info(client.stuff(base_worker.get_test_context())) time.sleep(0) # necessary for preventing Timeout exceptions
def test_main(): config.init(sys.argv[1:]) config.setup_logging() config.set_config_defaults() if not cfg.CONF.config_file: sys.exit(_("ERROR: Unable to find configuration file via the default" " search paths (~/.neutron/, ~/, /etc/neutron/, /etc/) and" " the '--config-file' option!")) context = QuarkAsyncTestContext() # typically context is neutron context client = QuarkRpcTestApi() LOG.info(client.stuff(context)) time.sleep(0) # necessary for preventing Timeout exceptions
def main(): config.init(sys.argv[1:]) config.setup_logging() config.set_config_defaults() if not cfg.CONF.config_file: sys.exit( _("ERROR: Unable to find configuration file via the default" " search paths (~/.neutron/, ~/, /etc/neutron/, /etc/) and" " the '--config-file' option!")) client = QuarkRpcTestApi(TEST_TOPIC) LOG.info(client.stuff(base_worker.get_test_context())) time.sleep(0) # necessary for preventing Timeout exceptions
def main(): config.init(sys.argv[1:]) config.setup_logging() config.set_config_defaults() if not cfg.CONF.config_file: sys.exit(_("ERROR: Unable to find configuration file via the" " default search paths (~/.neutron/, ~/, /etc/neutron/," " /etc/) and the '--config-file' option!")) try: QuarkAsyncServer().run() except KeyboardInterrupt: pass except RuntimeError as e: sys.exit(_("ERROR: %s") % e)
def boot_server(server_func): # the configuration will be read into the cfg.CONF global data structure config.init(sys.argv[1:]) config.setup_logging() config.set_config_defaults() if not cfg.CONF.config_file: sys.exit(_("ERROR: Unable to find configuration file via the default" " search paths (~/.neutron/, ~/, /etc/neutron/, /etc/) and" " the '--config-file' option!")) try: server_func() except KeyboardInterrupt: pass except RuntimeError as e: sys.exit(_("ERROR: %s") % e)
def boot_server(server_func): # the configuration will be read into the cfg.CONF global data structure config.init(sys.argv[1:]) config.setup_logging() config.set_config_defaults() if not cfg.CONF.config_file: sys.exit( _("ERROR: Unable to find configuration file via the default" " search paths (~/.neutron/, ~/, /etc/neutron/, /etc/) and" " the '--config-file' option!")) try: server_func() # _main_neutron_server except KeyboardInterrupt: pass except RuntimeError as e: sys.exit(_("ERROR: %s") % e)