def init(): global _POLICY_PATH global _POLICY_CACHE if not _POLICY_PATH: _POLICY_PATH = utils.find_config(FLAGS.policy_file) utils.read_cached_file(_POLICY_PATH, _POLICY_CACHE, reload_func=_set_brain)
def test_find_config(self, mock_exists): path = '/etc/cinder/cinder.conf' cfgpath = utils.find_config(path) self.assertEqual(path, cfgpath) mock_exists.return_value = False self.assertRaises(exception.ConfigNotFound, utils.find_config, path)
def init(): global _POLICY_PATH global _POLICY_CACHE if not _POLICY_PATH: _POLICY_PATH = utils.find_config(CONF.policy_file) utils.read_cached_file(_POLICY_PATH, _POLICY_CACHE, reload_func=_set_brain)
def __init__(self, config_path=None): """Initialize the loader, and attempt to find the config. :param config_path: Full or relative path to the paste config. :returns: None """ config_path = config_path or CONF.api_paste_config self.config_path = utils.find_config(config_path)