Пример #1
0
    def load_backends(self):
        """Initializes each manager and assigns them to an attribute."""

        # TODO(blk-u): Shouldn't need to clear the registry here, but some
        # tests call load_backends multiple times. These should be fixed to
        # only call load_backends once.
        dependency.reset()

        # TODO(morganfainberg): Shouldn't need to clear the registry here, but
        # some tests call load_backends multiple times.  Since it is not
        # possible to re-configure a backend, we need to clear the list.  This
        # should eventually be removed once testing has been cleaned up.
        kvs_core.KEY_VALUE_STORE_REGISTRY.clear()

        self.clear_auth_plugin_registry()
        drivers = service.load_backends()

        drivers.update(dependency.resolve_future_dependencies())

        for manager_name, manager in six.iteritems(drivers):
            setattr(self, manager_name, manager)
        self.addCleanup(self.cleanup_instance(*drivers.keys()))

        # The credential backend only supports SQL, so we always have to load
        # the tables.
        self.engine = sql.get_engine()
        self.addCleanup(sql.cleanup)
        self.addCleanup(self.cleanup_instance('engine'))

        sql.ModelBase.metadata.create_all(bind=self.engine)
        self.addCleanup(sql.ModelBase.metadata.drop_all, bind=self.engine)
Пример #2
0
    def load_backends(self):
        """Initializes each manager and assigns them to an attribute."""

        # TODO(blk-u): Shouldn't need to clear the registry here, but some
        # tests call load_backends multiple times. These should be fixed to
        # only call load_backends once.
        dependency.reset()

        # TODO(morganfainberg): Shouldn't need to clear the registry here, but
        # some tests call load_backends multiple times.  Since it is not
        # possible to re-configure a backend, we need to clear the list.  This
        # should eventually be removed once testing has been cleaned up.
        kvs_core.KEY_VALUE_STORE_REGISTRY.clear()

        self.clear_auth_plugin_registry()
        drivers = service.load_backends()

        drivers.update(dependency.resolve_future_dependencies())

        for manager_name, manager in six.iteritems(drivers):
            setattr(self, manager_name, manager)
        self.addCleanup(self.cleanup_instance(*drivers.keys()))

        # The credential backend only supports SQL, so we always have to load
        # the tables.
        self.engine = sql.get_engine()
        self.addCleanup(sql.cleanup)
        self.addCleanup(self.cleanup_instance('engine'))

        sql.ModelBase.metadata.create_all(bind=self.engine)
        self.addCleanup(sql.ModelBase.metadata.drop_all, bind=self.engine)
Пример #3
0
    def load_backends(self):
        """Initializes each manager and assigns them to an attribute."""

        # TODO(blk-u): Shouldn't need to clear the registry here, but some
        # tests call load_backends multiple times. These should be fixed to
        # only call load_backends once.
        dependency.reset()

        # TODO(morganfainberg): Shouldn't need to clear the registry here, but
        # some tests call load_backends multiple times.  Since it is not
        # possible to re-configure a backend, we need to clear the list.  This
        # should eventually be removed once testing has been cleaned up.
        kvs_core.KEY_VALUE_STORE_REGISTRY.clear()

        drivers = service.load_backends()

        # TODO(stevemar): currently, load oauth1 driver as well, eventually
        # we need to have this as optional.
        from keystone.contrib import oauth1
        drivers['oauth1_api'] = oauth1.Manager()

        dependency.resolve_future_dependencies()

        for manager_name, manager in drivers.iteritems():
            setattr(self, manager_name, manager)
Пример #4
0
    def load_backends(self):
        """Initializes each manager and assigns them to an attribute."""

        # TODO(blk-u): Shouldn't need to clear the registry here, but some
        # tests call load_backends multiple times. These should be fixed to
        # only call load_backends once.
        dependency.reset()

        # TODO(morganfainberg): Shouldn't need to clear the registry here, but
        # some tests call load_backends multiple times.  Since it is not
        # possible to re-configure a backend, we need to clear the list.  This
        # should eventually be removed once testing has been cleaned up.
        kvs_core.KEY_VALUE_STORE_REGISTRY.clear()

        drivers = service.load_backends()

        # TODO(stevemar): currently, load oauth1 driver as well, eventually
        # we need to have this as optional.
        from keystone.contrib import oauth1
        drivers['oauth1_api'] = oauth1.Manager()

        from keystone.contrib import federation
        drivers['federation_api'] = federation.Manager()

        dependency.resolve_future_dependencies()

        for manager_name, manager in six.iteritems(drivers):
            setattr(self, manager_name, manager)
Пример #5
0
    def load_backends(self):
        """Initializes each manager and assigns them to an attribute."""

        # TODO(blk-u): Shouldn't need to clear the registry here, but some
        # tests call load_backends multiple times. These should be fixed to
        # only call load_backends once.
        dependency.reset()

        # TODO(morganfainberg): Shouldn't need to clear the registry here, but
        # some tests call load_backends multiple times.  Since it is not
        # possible to re-configure a backend, we need to clear the list.  This
        # should eventually be removed once testing has been cleaned up.
        kvs_core.KEY_VALUE_STORE_REGISTRY.clear()

        drivers = service.load_backends(include_oauth1=True)

        for manager_name, manager in drivers.iteritems():
            setattr(self, manager_name, manager)
Пример #6
0
    def load_backends(self):
        """Initializes each manager and assigns them to an attribute."""

        # TODO(blk-u): Shouldn't need to clear the registry here, but some
        # tests call load_backends multiple times. These should be fixed to
        # only call load_backends once.
        dependency.reset()

        # TODO(morganfainberg): Shouldn't need to clear the registry here, but
        # some tests call load_backends multiple times.  Since it is not
        # possible to re-configure a backend, we need to clear the list.  This
        # should eventually be removed once testing has been cleaned up.
        kvs_core.KEY_VALUE_STORE_REGISTRY.clear()

        drivers = service.load_backends(include_oauth1=True)

        for manager_name, manager in drivers.iteritems():
            setattr(self, manager_name, manager)
Пример #7
0
    def load_backends(self):
        """Initializes each manager and assigns them to an attribute."""

        # TODO(blk-u): Shouldn't need to clear the registry here, but some
        # tests call load_backends multiple times. These should be fixed to
        # only call load_backends once.
        dependency.reset()

        # TODO(morganfainberg): Shouldn't need to clear the registry here, but
        # some tests call load_backends multiple times.  Since it is not
        # possible to re-configure a backend, we need to clear the list.  This
        # should eventually be removed once testing has been cleaned up.
        kvs_core.KEY_VALUE_STORE_REGISTRY.clear()

        self.clear_auth_plugin_registry()
        drivers = service.load_backends()

        # TODO(stevemar): currently, load oauth1 driver as well, eventually
        # we need to have this as optional.
        from keystone.contrib import oauth1
        drivers['oauth1_api'] = oauth1.Manager()

        from keystone.contrib import federation
        drivers['federation_api'] = federation.Manager()

        dependency.resolve_future_dependencies()

        for manager_name, manager in six.iteritems(drivers):
            setattr(self, manager_name, manager)

        # The credential backend only supports SQL, so we always have to load
        # the tables.
        self.engine = session.get_engine()
        self.addCleanup(session.cleanup)

        sql.ModelBase.metadata.create_all(bind=self.engine)
        self.addCleanup(sql.ModelBase.metadata.drop_all, bind=self.engine)
Пример #8
0
    def load_backends(self):
        """Initializes each manager and assigns them to an attribute."""

        # TODO(blk-u): Shouldn't need to clear the registry here, but some
        # tests call load_backends multiple times. These should be fixed to
        # only call load_backends once.
        dependency.reset()

        # TODO(morganfainberg): Shouldn't need to clear the registry here, but
        # some tests call load_backends multiple times.  Since it is not
        # possible to re-configure a backend, we need to clear the list.  This
        # should eventually be removed once testing has been cleaned up.
        kvs_core.KEY_VALUE_STORE_REGISTRY.clear()

        self.clear_auth_plugin_registry()
        drivers = service.load_backends()

        # TODO(stevemar): currently, load oauth1 driver as well, eventually
        # we need to have this as optional.
        from keystone.contrib import oauth1
        drivers['oauth1_api'] = oauth1.Manager()

        from keystone.contrib import federation
        drivers['federation_api'] = federation.Manager()

        dependency.resolve_future_dependencies()

        for manager_name, manager in six.iteritems(drivers):
            setattr(self, manager_name, manager)

        # The credential backend only supports SQL, so we always have to load
        # the tables.
        self.engine = session.get_engine()
        self.addCleanup(session.cleanup)

        sql.ModelBase.metadata.create_all(bind=self.engine)
        self.addCleanup(sql.ModelBase.metadata.drop_all, bind=self.engine)
Пример #9
0
gettextutils.install('keystone')

from keystone.common import environment
from keystone.common import sql
from keystone import config
from keystone.openstack.common import log
from keystone import service


CONF = config.CONF

sql.initialize()

CONF(project='keystone')
config.setup_logging()

environment.use_stdlib()
name = os.path.basename(__file__)

if CONF.debug:
    CONF.log_opt_values(log.getLogger(CONF.prog), logging.DEBUG)


drivers = service.load_backends()

# NOTE(ldbragst): 'application' is required in this context by WSGI spec.
# The following is a reference to Python Paste Deploy documentation
# http://pythonpaste.org/deploy/
application = deploy.loadapp('config:%s' % config.find_paste_config(),
                             name=name)
Пример #10
0
from keystone.common import dependency
from keystone.common import environment
from keystone.common import sql
from keystone import config
from keystone.openstack.common import log
from keystone import service

CONF = config.CONF

config.configure()
sql.initialize()

CONF(project='keystone')
config.setup_logging()

environment.use_stdlib()
name = os.path.basename(__file__)

if CONF.debug:
    CONF.log_opt_values(log.getLogger(CONF.prog), logging.DEBUG)

drivers = service.load_backends()

# NOTE(ldbragst): 'application' is required in this context by WSGI spec.
# The following is a reference to Python Paste Deploy documentation
# http://pythonpaste.org/deploy/
application = deploy.loadapp('config:%s' % config.find_paste_config(),
                             name=name)

dependency.resolve_future_dependencies()