aboutsummaryrefslogtreecommitdiffstats
path: root/keystone-moon/keystone/server
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2015-09-01 16:03:26 +0200
committerasteroide <thomas.duval@orange.com>2015-09-01 16:04:53 +0200
commit92fd2dbfb672d7b2b1cdfd5dd5cf89f7716b3e12 (patch)
tree7ba22297042019e7363fa1d4ad26d1c32c5908c6 /keystone-moon/keystone/server
parent26e753254f3e43399cc76e62892908b7742415e8 (diff)
Update Keystone code from official Github repository with branch Master on 09/01/2015.
Change-Id: I0ff6099e6e2580f87f502002a998bbfe12673498
Diffstat (limited to 'keystone-moon/keystone/server')
-rw-r--r--keystone-moon/keystone/server/backends.py64
-rw-r--r--keystone-moon/keystone/server/common.py2
-rw-r--r--keystone-moon/keystone/server/eventlet.py8
-rw-r--r--keystone-moon/keystone/server/wsgi.py8
4 files changed, 77 insertions, 5 deletions
diff --git a/keystone-moon/keystone/server/backends.py b/keystone-moon/keystone/server/backends.py
new file mode 100644
index 00000000..ebe00a81
--- /dev/null
+++ b/keystone-moon/keystone/server/backends.py
@@ -0,0 +1,64 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from keystone import assignment
+from keystone import auth
+from keystone import catalog
+from keystone.common import cache
+from keystone.contrib import endpoint_filter
+from keystone.contrib import federation
+from keystone.contrib import oauth1
+from keystone.contrib import revoke
+from keystone import credential
+from keystone import endpoint_policy
+from keystone import identity
+from keystone import policy
+from keystone import resource
+from keystone import token
+from keystone import trust
+
+
+def load_backends():
+
+ # Configure and build the cache
+ cache.configure_cache_region(cache.REGION)
+
+ # Ensure that the identity driver is created before the assignment manager
+ # and that the assignment driver is created before the resource manager.
+ # The default resource driver depends on assignment, which in turn
+ # depends on identity - hence we need to ensure the chain is available.
+ _IDENTITY_API = identity.Manager()
+ _ASSIGNMENT_API = assignment.Manager()
+
+ DRIVERS = dict(
+ assignment_api=_ASSIGNMENT_API,
+ catalog_api=catalog.Manager(),
+ credential_api=credential.Manager(),
+ domain_config_api=resource.DomainConfigManager(),
+ endpoint_filter_api=endpoint_filter.Manager(),
+ endpoint_policy_api=endpoint_policy.Manager(),
+ federation_api=federation.Manager(),
+ id_generator_api=identity.generator.Manager(),
+ id_mapping_api=identity.MappingManager(),
+ identity_api=_IDENTITY_API,
+ oauth_api=oauth1.Manager(),
+ policy_api=policy.Manager(),
+ resource_api=resource.Manager(),
+ revoke_api=revoke.Manager(),
+ role_api=assignment.RoleManager(),
+ token_api=token.persistence.Manager(),
+ trust_api=trust.Manager(),
+ token_provider_api=token.provider.Manager())
+
+ auth.controllers.load_auth_methods()
+
+ return DRIVERS
diff --git a/keystone-moon/keystone/server/common.py b/keystone-moon/keystone/server/common.py
index fda44eea..2de6d39e 100644
--- a/keystone-moon/keystone/server/common.py
+++ b/keystone-moon/keystone/server/common.py
@@ -14,10 +14,10 @@
from oslo_config import cfg
-from keystone import backends
from keystone.common import dependency
from keystone.common import sql
from keystone import config
+from keystone.server import backends
CONF = cfg.CONF
diff --git a/keystone-moon/keystone/server/eventlet.py b/keystone-moon/keystone/server/eventlet.py
index 5bedaf9b..243f0234 100644
--- a/keystone-moon/keystone/server/eventlet.py
+++ b/keystone-moon/keystone/server/eventlet.py
@@ -20,6 +20,8 @@ import socket
from oslo_concurrency import processutils
from oslo_config import cfg
import oslo_i18n
+from oslo_service import service
+from oslo_service import systemd
import pbr.version
@@ -34,8 +36,6 @@ from keystone.common import environment
from keystone.common import utils
from keystone import config
from keystone.i18n import _
-from keystone.openstack.common import service
-from keystone.openstack.common import systemd
from keystone.server import common
from keystone import service as keystone_service
@@ -79,9 +79,9 @@ def serve(*servers):
'Support for keystone under eventlet will be removed in '
'the "M"-Release.'))
if max([server[1].workers for server in servers]) > 1:
- launcher = service.ProcessLauncher()
+ launcher = service.ProcessLauncher(CONF)
else:
- launcher = service.ServiceLauncher()
+ launcher = service.ServiceLauncher(CONF)
for name, server in servers:
try:
diff --git a/keystone-moon/keystone/server/wsgi.py b/keystone-moon/keystone/server/wsgi.py
index 863f13bc..dbdad326 100644
--- a/keystone-moon/keystone/server/wsgi.py
+++ b/keystone-moon/keystone/server/wsgi.py
@@ -50,3 +50,11 @@ def initialize_application(name):
_unused, application = common.setup_backends(
startup_application_fn=loadapp)
return application
+
+
+def initialize_admin_application():
+ return initialize_application('admin')
+
+
+def initialize_public_application():
+ return initialize_application('main')