def parse_args(argv, default_config_files=None): log.set_defaults(_DEFAULT_LOGGING_CONTEXT_FORMAT, _DEFAULT_LOG_LEVELS) log.register_options(CONF) gmr_opts.set_defaults(CONF) rpc.set_defaults(control_exchange='miper') CONF(argv[1:], project='miper', version='0.0.2', default_config_files=default_config_files) gmr.TextGuruMeditation.setup_autorun('0.0.2', conf=CONF) rpc.init(CONF)
from miper.common import wsgi from miper.common import rpc _lazy.enable_lazy() LOG = logging.getLogger('miper.api') if __name__ == '__main__': try: logging.register_options(cfg.CONF) cfg.CONF(project='miper', prog='miper-api', version='0.0.2') logging.setup(cfg.CONF, 'miper-api') # messaging configuration rpc.set_defaults(control_exchange='miper') rpc.init(cfg.CONF) conf_file = os.path.join(possible_topdir, "etc", "api-paste.ini") app = deploy.loadapp("config:%s" % conf_file, 'main') host = cfg.CONF.miper_api.bind_host port = cfg.CONF.miper_api.bind_port LOG.info(_LI('Starting Miper API on %(host)s:%(port)s'), {'host': host, 'port': port}) server = wsgi.Server('miper-api', cfg.CONF.miper_api) server.start(app, default_port=port) systemd.notify_once() server.wait() except RuntimeError as ex: sys.exit("ERROR: %s" % six.text_type(ex))