def main(): try: config.parse_args() config.set_middleware_defaults() request_statistics.init_stats() policy.init() logging.setup(CONF, 'murano') workers = CONF.murano.api_workers if not workers: workers = processutils.get_worker_count() launcher = service.launch(CONF, server.ApiService(), workers=workers, restart_method='mutate') app = app_loader.load_paste_app('murano') port, host = (CONF.bind_port, CONF.bind_host) launcher.launch_service(wsgi.Service(app, port, host)) launcher.launch_service(server.NotificationService()) launcher.launch_service(stats.StatsCollectingService()) launcher.wait() except RuntimeError as e: sys.stderr.write("ERROR: %s\n" % e) sys.exit(1)
def test_api_service_class(self, mock_messaging): mock_server = mock.MagicMock() mock_messaging.get_rpc_server.return_value = mock_server api_service = server.ApiService() api_service.start() self.assertEqual(1, mock_messaging.get_rpc_server.call_count) mock_server.start.assert_called_once_with()
def main(): try: config.parse_args() logging.setup(CONF, 'murano-cfapi') request_statistics.init_stats() policy.init() launcher = service.ServiceLauncher(CONF) cfapp = app_loader.load_paste_app('cloudfoundry') cfport, cfhost = (config.CONF.cfapi.bind_port, config.CONF.cfapi.bind_host) launcher.launch_service(wsgi.Service(cfapp, cfport, cfhost)) launcher.launch_service(server.ApiService()) launcher.launch_service(server.NotificationService()) launcher.wait() except RuntimeError as e: sys.stderr.write("ERROR: %s\n" % e) sys.exit(1)
def main(): try: config.parse_args() config.set_middleware_defaults() request_statistics.init_stats() policy.init() logging.setup(CONF, 'murano') launcher = service.ServiceLauncher(CONF) app = app_loader.load_paste_app('murano') port, host = (CONF.bind_port, CONF.bind_host) launcher.launch_service(wsgi.Service(app, port, host)) launcher.launch_service(server.ApiService()) launcher.launch_service(server.NotificationService()) launcher.launch_service(stats.StatsCollectingService()) launcher.wait() except RuntimeError as e: sys.stderr.write("ERROR: %s\n" % e) sys.exit(1)