From 920a49cfa055733d575282973e23558c33087a4a Mon Sep 17 00:00:00 2001 From: RHE Date: Fri, 24 Nov 2017 13:54:26 +0100 Subject: remove keystone-moon Change-Id: I80d7c9b669f19d5f6607e162de8e0e55c2f80fdd Signed-off-by: RHE --- keystone-moon/keystone/server/__init__.py | 0 keystone-moon/keystone/server/backends.py | 74 -------------- keystone-moon/keystone/server/common.py | 53 ---------- keystone-moon/keystone/server/eventlet.py | 156 ------------------------------ keystone-moon/keystone/server/wsgi.py | 62 ------------ 5 files changed, 345 deletions(-) delete mode 100644 keystone-moon/keystone/server/__init__.py delete mode 100644 keystone-moon/keystone/server/backends.py delete mode 100644 keystone-moon/keystone/server/common.py delete mode 100644 keystone-moon/keystone/server/eventlet.py delete mode 100644 keystone-moon/keystone/server/wsgi.py (limited to 'keystone-moon/keystone/server') diff --git a/keystone-moon/keystone/server/__init__.py b/keystone-moon/keystone/server/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/keystone-moon/keystone/server/backends.py b/keystone-moon/keystone/server/backends.py deleted file mode 100644 index a518e777..00000000 --- a/keystone-moon/keystone/server/backends.py +++ /dev/null @@ -1,74 +0,0 @@ -# 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 import credential -from keystone import endpoint_policy -from keystone import federation -from keystone import identity -from keystone import oauth1 -from keystone import policy -from keystone import resource -from keystone import revoke -from keystone import token -from keystone import trust - - -def load_backends(): - - # Configure and build the cache - cache.configure_cache() - cache.configure_cache(region=catalog.COMPUTED_CATALOG_REGION) - cache.apply_invalidation_patch( - region=catalog.COMPUTED_CATALOG_REGION, - region_name=catalog.COMPUTED_CATALOG_REGION.name) - cache.configure_cache(region=assignment.COMPUTED_ASSIGNMENTS_REGION) - cache.apply_invalidation_patch( - region=assignment.COMPUTED_ASSIGNMENTS_REGION, - region_name=assignment.COMPUTED_ASSIGNMENTS_REGION.name) - - # 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. - # TODO(morganfainberg): In "O" release move _IDENTITY_API to be directly - # instantiated in the DRIVERS dict once assignment driver being selected - # based upon [identity]/driver is removed. - _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_policy_api=endpoint_policy.Manager(), - federation_api=federation.Manager(), - id_generator_api=identity.generator.Manager(), - id_mapping_api=identity.MappingManager(), - identity_api=_IDENTITY_API, - shadow_users_api=identity.ShadowUsersManager(), - 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 deleted file mode 100644 index 4b1ee469..00000000 --- a/keystone-moon/keystone/server/common.py +++ /dev/null @@ -1,53 +0,0 @@ - -# 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 oslo_config import cfg -from oslo_log import log - -from keystone.common import config -from keystone.common import dependency -from keystone.common import sql -from keystone.i18n import _LW -from keystone.server import backends - - -CONF = cfg.CONF -LOG = log.getLogger(__name__) - - -def configure(version=None, config_files=None, - pre_setup_logging_fn=lambda: None): - config.configure() - sql.initialize() - config.set_config_defaults() - - CONF(project='keystone', version=version, - default_config_files=config_files) - - pre_setup_logging_fn() - config.setup_logging() - - if CONF.insecure_debug: - LOG.warning(_LW( - 'insecure_debug is enabled so responses may include sensitive ' - 'information.')) - - -def setup_backends(load_extra_backends_fn=lambda: {}, - startup_application_fn=lambda: None): - drivers = backends.load_backends() - drivers.update(load_extra_backends_fn()) - res = startup_application_fn() - drivers.update(dependency.resolve_future_dependencies()) - return drivers, res diff --git a/keystone-moon/keystone/server/eventlet.py b/keystone-moon/keystone/server/eventlet.py deleted file mode 100644 index e688baed..00000000 --- a/keystone-moon/keystone/server/eventlet.py +++ /dev/null @@ -1,156 +0,0 @@ - -# Copyright 2013 OpenStack Foundation -# -# 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. - -import logging -import os -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 - - -# NOTE(dstanek): i18n.enable_lazy() must be called before -# keystone.i18n._() is called to ensure it has the desired lazy lookup -# behavior. This includes cases, like keystone.exceptions, where -# keystone.i18n._() is called at import time. -oslo_i18n.enable_lazy() - - -from keystone.common import config -from keystone.common import environment -from keystone.common import utils -from keystone.i18n import _ -from keystone.server import common -from keystone.version import service as keystone_service - - -CONF = cfg.CONF - - -class ServerWrapper(object): - """Wraps a Server with some launching info & capabilities.""" - - def __init__(self, server, workers): - self.server = server - self.workers = workers - - def launch_with(self, launcher): - self.server.listen() - if self.workers > 1: - # Use multi-process launcher - launcher.launch_service(self.server, self.workers) - else: - # Use single process launcher - launcher.launch_service(self.server) - - -def create_server(conf, name, host, port, workers): - app = keystone_service.loadapp('config:%s' % conf, name) - server = environment.Server(app, host=host, port=port, - keepalive=CONF.eventlet_server.tcp_keepalive, - keepidle=CONF.eventlet_server.tcp_keepidle) - if CONF.eventlet_server_ssl.enable: - server.set_ssl(CONF.eventlet_server_ssl.certfile, - CONF.eventlet_server_ssl.keyfile, - CONF.eventlet_server_ssl.ca_certs, - CONF.eventlet_server_ssl.cert_required) - return name, ServerWrapper(server, workers) - - -def serve(*servers): - logging.warning(_('Running keystone via eventlet is deprecated as of Kilo ' - 'in favor of running in a WSGI server (e.g. mod_wsgi). ' - '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(CONF) - else: - launcher = service.ServiceLauncher(CONF) - - for name, server in servers: - try: - server.launch_with(launcher) - except socket.error: - logging.exception(_('Failed to start the %(name)s server') % { - 'name': name}) - raise - - # notify calling process we are ready to serve - systemd.notify_once() - - for name, server in servers: - launcher.wait() - - -def _get_workers(worker_type_config_opt): - # Get the value from config, if the config value is None (not set), return - # the number of cpus with a minimum of 2. - worker_count = CONF.eventlet_server.get(worker_type_config_opt) - if not worker_count: - worker_count = max(2, processutils.get_worker_count()) - return worker_count - - -def configure_threading(): - monkeypatch_thread = not CONF.standard_threads - pydev_debug_url = utils.setup_remote_pydev_debug() - if pydev_debug_url: - # in order to work around errors caused by monkey patching we have to - # set the thread to False. An explanation is here: - # http://lists.openstack.org/pipermail/openstack-dev/2012-August/ - # 000794.html - monkeypatch_thread = False - environment.use_eventlet(monkeypatch_thread) - - -def run(possible_topdir): - dev_conf = os.path.join(possible_topdir, - 'etc', - 'keystone.conf') - config_files = None - if os.path.exists(dev_conf): - config_files = [dev_conf] - - common.configure( - version=pbr.version.VersionInfo('keystone').version_string(), - config_files=config_files, - pre_setup_logging_fn=configure_threading) - - paste_config = config.find_paste_config() - - def create_servers(): - admin_worker_count = _get_workers('admin_workers') - public_worker_count = _get_workers('public_workers') - - servers = [] - servers.append(create_server(paste_config, - 'admin', - CONF.eventlet_server.admin_bind_host, - CONF.eventlet_server.admin_port, - admin_worker_count)) - servers.append(create_server(paste_config, - 'main', - CONF.eventlet_server.public_bind_host, - CONF.eventlet_server.public_port, - public_worker_count)) - return servers - - _unused, servers = common.setup_backends( - startup_application_fn=create_servers) - serve(*servers) diff --git a/keystone-moon/keystone/server/wsgi.py b/keystone-moon/keystone/server/wsgi.py deleted file mode 100644 index a62a8460..00000000 --- a/keystone-moon/keystone/server/wsgi.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright 2013 OpenStack Foundation -# -# 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. - -import logging - -from oslo_config import cfg -import oslo_i18n - - -# NOTE(dstanek): i18n.enable_lazy() must be called before -# keystone.i18n._() is called to ensure it has the desired lazy lookup -# behavior. This includes cases, like keystone.exceptions, where -# keystone.i18n._() is called at import time. -oslo_i18n.enable_lazy() - - -from keystone.common import config -from keystone.common import environment -from keystone.server import common -from keystone.version import service as keystone_service - - -CONF = cfg.CONF - - -def initialize_application(name, post_log_configured_function=lambda: None): - common.configure() - - # Log the options used when starting if we're in debug mode... - if CONF.debug: - CONF.log_opt_values(logging.getLogger(CONF.prog), logging.DEBUG) - - environment.use_stdlib() - - post_log_configured_function() - - def loadapp(): - return keystone_service.loadapp( - 'config:%s' % config.find_paste_config(), 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') -- cgit 1.2.3-korg