Пример #1
0
 def load_paste_config(cls, app_name, options, args, config_dir=None):
     conf_file, conf = openstack_config.load_paste_config(app_name,
                                                          options,
                                                          args,
                                                          config_dir=None)
     cls.instance = conf
     return conf
Пример #2
0
    def load_paste_app(cls, app_name, options, args, config_dir=None):
        # Loading code is here to call correct logging setup. (mdragon)
        conf_file, conf = openstack_config.load_paste_config(app_name,
                                                             options,
                                                             args,
                                                             config_dir=None)
        try:
            # Setup logging early, supplying both the CLI options and the
            # configuration mapping from the config file
            setup_logging(options, conf)

            # Log the options used when starting if we're in debug mode...
            if cls._setup_debug(options, conf):
                cls._show_debug_info(app_name, conf, conf_file)

            app = deploy.loadapp("config:%s" % conf_file, name=app_name)
        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})
        cls.instance = conf
        return conf, app
Пример #3
0
 def load_paste_config(cls, *args, **kwargs):
     conf_file, conf = openstack_config.load_paste_config(*args, **kwargs)
     cls.instance = conf
     return conf