Merge "rename templated.TemplatedCatalog to templated.Catalog"
This commit is contained in:
@@ -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)
|
You can also refer to `an example in Keystone (tools/sample_data.sh)
|
||||||
<https://github.com/openstack/keystone/blob/master/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
|
The templated catalog is an in-memory backend initialized from a read-only
|
||||||
``template_file``. Choose this option only if you know that your
|
``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::
|
``keystone.conf`` example::
|
||||||
|
|
||||||
[catalog]
|
[catalog]
|
||||||
driver = keystone.catalog.backends.templated.TemplatedCatalog
|
driver = keystone.catalog.backends.templated.Catalog
|
||||||
template_file = /opt/stack/keystone/etc/default_catalog.templates
|
template_file = /opt/stack/keystone/etc/default_catalog.templates
|
||||||
|
|
||||||
The value of ``template_file`` is expected to be an absolute path to your
|
The value of ``template_file`` is expected to be an absolute path to your
|
||||||
|
|||||||
@@ -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
|
# translations for keystone compat
|
||||||
catalog.RegionOne.identity.publicURL = http://localhost:$(public_port)s/v2.0
|
catalog.RegionOne.identity.publicURL = http://localhost:$(public_port)s/v2.0
|
||||||
catalog.RegionOne.identity.adminURL = http://localhost:$(admin_port)s/v2.0
|
catalog.RegionOne.identity.adminURL = http://localhost:$(admin_port)s/v2.0
|
||||||
|
|||||||
@@ -241,7 +241,7 @@
|
|||||||
# driver = keystone.catalog.backends.sql.Catalog
|
# driver = keystone.catalog.backends.sql.Catalog
|
||||||
|
|
||||||
# static, file-based backend (does *NOT* support any management commands)
|
# 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
|
# template_file = default_catalog.templates
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ from keystone.catalog import core
|
|||||||
from keystone import config
|
from keystone import config
|
||||||
from keystone import exception
|
from keystone import exception
|
||||||
from keystone.openstack.common import log
|
from keystone.openstack.common import log
|
||||||
|
from keystone.openstack.common import versionutils
|
||||||
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
@@ -57,10 +58,7 @@ def parse_templates(template_lines):
|
|||||||
return o
|
return o
|
||||||
|
|
||||||
|
|
||||||
# TODO(jaypipes): should be templated.Catalog,
|
class Catalog(kvs.Catalog):
|
||||||
# not templated.TemplatedCatalog to be consistent with
|
|
||||||
# other catalog backends
|
|
||||||
class TemplatedCatalog(kvs.Catalog):
|
|
||||||
"""A backend that generates endpoints for the Catalog based on templates.
|
"""A backend that generates endpoints for the Catalog based on templates.
|
||||||
|
|
||||||
It is usually configured via config entries that look like:
|
It is usually configured via config entries that look like:
|
||||||
@@ -93,6 +91,7 @@ class TemplatedCatalog(kvs.Catalog):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, templates=None):
|
def __init__(self, templates=None):
|
||||||
|
super(Catalog, self).__init__()
|
||||||
if templates:
|
if templates:
|
||||||
self.templates = templates
|
self.templates = templates
|
||||||
else:
|
else:
|
||||||
@@ -100,7 +99,6 @@ class TemplatedCatalog(kvs.Catalog):
|
|||||||
if not os.path.exists(template_file):
|
if not os.path.exists(template_file):
|
||||||
template_file = CONF.find_file(template_file)
|
template_file = CONF.find_file(template_file)
|
||||||
self._load_templates(template_file)
|
self._load_templates(template_file)
|
||||||
super(TemplatedCatalog, self).__init__()
|
|
||||||
|
|
||||||
def _load_templates(self, template_file):
|
def _load_templates(self, template_file):
|
||||||
try:
|
try:
|
||||||
@@ -126,3 +124,11 @@ class TemplatedCatalog(kvs.Catalog):
|
|||||||
|
|
||||||
def get_v3_catalog(self, user_id, tenant_id, metadata=None):
|
def get_v3_catalog(self, user_id, tenant_id, metadata=None):
|
||||||
raise exception.NotImplemented()
|
raise exception.NotImplemented()
|
||||||
|
|
||||||
|
|
||||||
|
@versionutils.deprecated(
|
||||||
|
versionutils.deprecated.ICEHOUSE,
|
||||||
|
in_favor_of='keystone.catalog.backends.templated.Catalog',
|
||||||
|
remove_in=+2)
|
||||||
|
class TemplatedCatalog(Catalog):
|
||||||
|
pass
|
||||||
|
|||||||
@@ -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
|
# translations for keystone compat
|
||||||
catalog.RegionOne.identity.publicURL = http://localhost:$(public_port)s/v2.0
|
catalog.RegionOne.identity.publicURL = http://localhost:$(public_port)s/v2.0
|
||||||
catalog.RegionOne.identity.adminURL = http://localhost:$(admin_port)s/v2.0
|
catalog.RegionOne.identity.adminURL = http://localhost:$(admin_port)s/v2.0
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ crypt_strength = 1000
|
|||||||
driver = keystone.identity.backends.kvs.Identity
|
driver = keystone.identity.backends.kvs.Identity
|
||||||
|
|
||||||
[catalog]
|
[catalog]
|
||||||
driver = keystone.catalog.backends.templated.TemplatedCatalog
|
driver = keystone.catalog.backends.templated.Catalog
|
||||||
template_file = default_catalog.templates
|
template_file = default_catalog.templates
|
||||||
|
|
||||||
[trust]
|
[trust]
|
||||||
|
|||||||
Reference in New Issue
Block a user