def load_paste_app(app_name=None):
 if (app_name is None):
  app_name = cfg.CONF.prog
 app_name += _get_deployment_flavor()
 conf_file = _get_deployment_config_file()
 if (conf_file is None):
  raise RuntimeError((_('Unable to locate config file [%s]') % cfg.CONF.paste_deploy['api_paste_config']))
 try:
  app = wsgi.paste_deploy_app(conf_file, app_name, cfg.CONF)
  if cfg.CONF.debug:
   cfg.CONF.log_opt_values(logging.getLogger(app_name), logging.DEBUG)
  return app
 except (LookupError, ImportError) as e:
  raise RuntimeError((_('Unable to load %(app_name)s from configuration file %(conf_file)s.\nGot: %(e)r') % {'app_name': app_name, 'conf_file': conf_file, 'e': e}))

def load_paste_app ( app_name = None ) : if ( app_name is None ) : app_name = cfg . CONF . prog app_name += _get_deployment_flavor ( ) conf_file = _get_deployment_config_file ( ) if ( conf_file is None ) : raise RuntimeError ( ( _ ( 'Unable to locate config file [%s]' ) % cfg . CONF . paste_deploy [ 'api_paste_config' ] ) ) try : app = wsgi . paste_deploy_app ( conf_file , app_name , cfg . CONF ) if cfg . CONF . debug : cfg . CONF . log_opt_values ( logging . getLogger ( app_name ) , logging . DEBUG ) return app except ( LookupError , ImportError ) as e : raise RuntimeError ( ( _ ( 'Unable to load %(app_name)s from configuration file %(conf_file)s.\nGot: %(e)r' ) % { 'app_name' : app_name , 'conf_file' : conf_file , 'e' : e } ) )
builds and returns a wsgi app from a paste config file .