diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index 484dbff8d4..90e3e645d3 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -467,8 +467,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) `_. -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 @@ -485,7 +485,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 diff --git a/etc/default_catalog.templates b/etc/default_catalog.templates index eb1e04470f..e7a3d407f6 100644 --- a/etc/default_catalog.templates +++ b/etc/default_catalog.templates @@ -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 diff --git a/etc/keystone.conf.sample b/etc/keystone.conf.sample index 8396a9c9b9..d15001b472 100644 --- a/etc/keystone.conf.sample +++ b/etc/keystone.conf.sample @@ -237,7 +237,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 diff --git a/keystone/catalog/backends/templated.py b/keystone/catalog/backends/templated.py index af7fc3d194..e8ff97d587 100644 --- a/keystone/catalog/backends/templated.py +++ b/keystone/catalog/backends/templated.py @@ -21,6 +21,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__) @@ -55,10 +56,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: @@ -91,6 +89,7 @@ class TemplatedCatalog(kvs.Catalog): """ def __init__(self, templates=None): + super(Catalog, self).__init__() if templates: self.templates = templates else: @@ -98,7 +97,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: @@ -124,3 +122,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 diff --git a/keystone/tests/default_catalog.templates b/keystone/tests/default_catalog.templates index f26c949ac4..7efe7d55a5 100644 --- a/keystone/tests/default_catalog.templates +++ b/keystone/tests/default_catalog.templates @@ -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 diff --git a/keystone/tests/test_overrides.conf b/keystone/tests/test_overrides.conf index b33ad48808..fe5d1fa077 100644 --- a/keystone/tests/test_overrides.conf +++ b/keystone/tests/test_overrides.conf @@ -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]