Merge "rename templated.TemplatedCatalog to templated.Catalog"

This commit is contained in:
Jenkins
2014-02-08 01:14:20 +00:00
committed by Gerrit Code Review
6 changed files with 18 additions and 12 deletions

View File

@@ -468,8 +468,8 @@ To build your service catalog using this driver, see the built-in help::
You can also refer to `an example in Keystone (tools/sample_data.sh)
<https://github.com/openstack/keystone/blob/master/tools/sample_data.sh>`_.
File-based Service Catalog (``templated.TemplatedCatalog``)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File-based Service Catalog (``templated.Catalog``)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The templated catalog is an in-memory backend initialized from a read-only
``template_file``. Choose this option only if you know that your
@@ -486,7 +486,7 @@ service catalog will not change very much over time.
``keystone.conf`` example::
[catalog]
driver = keystone.catalog.backends.templated.TemplatedCatalog
driver = keystone.catalog.backends.templated.Catalog
template_file = /opt/stack/keystone/etc/default_catalog.templates
The value of ``template_file`` is expected to be an absolute path to your

View File

@@ -1,4 +1,4 @@
# config for TemplatedCatalog, using camelCase because I don't want to do
# config for templated.Catalog, using camelCase because I don't want to do
# translations for keystone compat
catalog.RegionOne.identity.publicURL = http://localhost:$(public_port)s/v2.0
catalog.RegionOne.identity.adminURL = http://localhost:$(admin_port)s/v2.0

View File

@@ -241,7 +241,7 @@
# driver = keystone.catalog.backends.sql.Catalog
# static, file-based backend (does *NOT* support any management commands)
# driver = keystone.catalog.backends.templated.TemplatedCatalog
# driver = keystone.catalog.backends.templated.Catalog
# template_file = default_catalog.templates

View File

@@ -23,6 +23,7 @@ from keystone.catalog import core
from keystone import config
from keystone import exception
from keystone.openstack.common import log
from keystone.openstack.common import versionutils
LOG = log.getLogger(__name__)
@@ -57,10 +58,7 @@ def parse_templates(template_lines):
return o
# TODO(jaypipes): should be templated.Catalog,
# not templated.TemplatedCatalog to be consistent with
# other catalog backends
class TemplatedCatalog(kvs.Catalog):
class Catalog(kvs.Catalog):
"""A backend that generates endpoints for the Catalog based on templates.
It is usually configured via config entries that look like:
@@ -93,6 +91,7 @@ class TemplatedCatalog(kvs.Catalog):
"""
def __init__(self, templates=None):
super(Catalog, self).__init__()
if templates:
self.templates = templates
else:
@@ -100,7 +99,6 @@ class TemplatedCatalog(kvs.Catalog):
if not os.path.exists(template_file):
template_file = CONF.find_file(template_file)
self._load_templates(template_file)
super(TemplatedCatalog, self).__init__()
def _load_templates(self, template_file):
try:
@@ -126,3 +124,11 @@ class TemplatedCatalog(kvs.Catalog):
def get_v3_catalog(self, user_id, tenant_id, metadata=None):
raise exception.NotImplemented()
@versionutils.deprecated(
versionutils.deprecated.ICEHOUSE,
in_favor_of='keystone.catalog.backends.templated.Catalog',
remove_in=+2)
class TemplatedCatalog(Catalog):
pass

View File

@@ -1,4 +1,4 @@
# config for TemplatedCatalog, using camelCase because I don't want to do
# config for templated.Catalog, using camelCase because I don't want to do
# translations for keystone compat
catalog.RegionOne.identity.publicURL = http://localhost:$(public_port)s/v2.0
catalog.RegionOne.identity.adminURL = http://localhost:$(admin_port)s/v2.0

View File

@@ -5,7 +5,7 @@ crypt_strength = 1000
driver = keystone.identity.backends.kvs.Identity
[catalog]
driver = keystone.catalog.backends.templated.TemplatedCatalog
driver = keystone.catalog.backends.templated.Catalog
template_file = default_catalog.templates
[trust]