def main(): config.parse_args(sys.argv) logging.setup(CONF, "patron") LOG = logging.getLogger('patron.all') utils.monkey_patch() objects.register_all() launcher = service.process_launcher() # patron-api for api in CONF.enabled_apis: try: should_use_ssl = api in CONF.enabled_ssl_apis server = service.WSGIService(api, use_ssl=should_use_ssl) launcher.launch_service(server, workers=server.workers or 1) except (Exception, SystemExit): LOG.exception(_LE('Failed to load %s-api'), api) for mod in [s3server, xvp_proxy]: try: launcher.launch_service(mod.get_wsgi_server()) except (Exception, SystemExit): LOG.exception(_LE('Failed to load %s'), mod.__name__) for binary in ['patron-compute', 'patron-network', 'patron-scheduler', 'patron-cert', 'patron-conductor']: # FIXME(sirp): Most service configs are defined in patron/service.py, but # conductor has set a new precedent of storing these configs # patron/<service>/api.py. # # We should update the existing services to use this new approach so we # don't have to treat conductor differently here. if binary == 'patron-conductor': topic = CONF.conductor.topic manager = CONF.conductor.manager else: topic = None manager = None try: launcher.launch_service(service.Service.create(binary=binary, topic=topic, manager=manager)) except (Exception, SystemExit): LOG.exception(_LE('Failed to load %s'), binary) launcher.wait()
def main(): config.parse_args(sys.argv) logging.setup(CONF, "patron") utils.monkey_patch() objects.register_all() gmr.TextGuruMeditation.setup_autorun(version) launcher = service.process_launcher() for api in CONF.enabled_apis: should_use_ssl = api in CONF.enabled_ssl_apis if api == 'ec2': server = service.WSGIService(api, use_ssl=should_use_ssl, max_url_len=16384) else: server = service.WSGIService(api, use_ssl=should_use_ssl) launcher.launch_service(server, workers=server.workers or 1) launcher.wait()
def main(): config.parse_args(sys.argv) logging.setup(CONF, "patron") LOG = logging.getLogger("patron.all") utils.monkey_patch() objects.register_all() launcher = service.process_launcher() # patron-api for api in CONF.enabled_apis: try: should_use_ssl = api in CONF.enabled_ssl_apis server = service.WSGIService(api, use_ssl=should_use_ssl) launcher.launch_service(server, workers=server.workers or 1) except (Exception, SystemExit): LOG.exception(_LE("Failed to load %s-api"), api) for mod in [s3server, xvp_proxy]: try: launcher.launch_service(mod.get_wsgi_server()) except (Exception, SystemExit): LOG.exception(_LE("Failed to load %s"), mod.__name__) for binary in ["patron-compute", "patron-network", "patron-scheduler", "patron-cert", "patron-conductor"]: # FIXME(sirp): Most service configs are defined in patron/service.py, but # conductor has set a new precedent of storing these configs # patron/<service>/api.py. # # We should update the existing services to use this new approach so we # don't have to treat conductor differently here. if binary == "patron-conductor": topic = CONF.conductor.topic manager = CONF.conductor.manager else: topic = None manager = None try: launcher.launch_service(service.Service.create(binary=binary, topic=topic, manager=manager)) except (Exception, SystemExit): LOG.exception(_LE("Failed to load %s"), binary) launcher.wait()