Merge "Consistently use oslo_config.cfg.CONF"

This commit is contained in:
Jenkins 2015-02-19 01:07:24 +00:00 committed by Gerrit Code Review
commit ce701f2771
101 changed files with 221 additions and 201 deletions

View File

@ -15,20 +15,20 @@ from __future__ import absolute_import
import ldap as ldap
import ldap.filter
from oslo_config import cfg
from oslo_log import log
from keystone import assignment
from keystone.assignment.role_backends import ldap as ldap_role
from keystone.common import ldap as common_ldap
from keystone.common import models
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone.identity.backends import ldap as ldap_identity
from keystone.openstack.common import versionutils
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from oslo_log import log
import six
import sqlalchemy
@ -19,12 +20,11 @@ from sqlalchemy.sql.expression import false
from keystone import assignment as keystone_assignment
from keystone.common import sql
from keystone import config
from keystone import exception
from keystone.i18n import _
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -19,6 +19,7 @@ import copy
import functools
import uuid
from oslo_config import cfg
from oslo_log import log
from six.moves import urllib
@ -26,13 +27,12 @@ from keystone.assignment import schema
from keystone.common import controller
from keystone.common import dependency
from keystone.common import validation
from keystone import config
from keystone import exception
from keystone.i18n import _, _LW
from keystone.models import token_model
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -16,6 +16,7 @@
import abc
from oslo_config import cfg
from oslo_log import log
import six
@ -23,7 +24,6 @@ from keystone.common import cache
from keystone.common import dependency
from keystone.common import driver_hints
from keystone.common import manager
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone.i18n import _LI
@ -31,7 +31,7 @@ from keystone import notifications
from keystone.openstack.common import versionutils
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)
SHOULD_CACHE = cache.should_cache_fn('role')
@ -242,28 +242,28 @@ class Manager(manager.Manager):
"""
self.resource_api.get_project(tenant_id)
try:
self.role_api.get_role(config.CONF.member_role_id)
self.role_api.get_role(CONF.member_role_id)
self.driver.add_role_to_user_and_project(
user_id,
tenant_id,
config.CONF.member_role_id)
CONF.member_role_id)
except exception.RoleNotFound:
LOG.info(_LI("Creating the default role %s "
"because it does not exist."),
config.CONF.member_role_id)
CONF.member_role_id)
role = {'id': CONF.member_role_id,
'name': CONF.member_role_name}
try:
self.role_api.create_role(config.CONF.member_role_id, role)
self.role_api.create_role(CONF.member_role_id, role)
except exception.Conflict:
LOG.info(_LI("Creating the default role %s failed because it "
"was already created"),
config.CONF.member_role_id)
CONF.member_role_id)
# now that default role exists, the add should succeed
self.driver.add_role_to_user_and_project(
user_id,
tenant_id,
config.CONF.member_role_id)
CONF.member_role_id)
def add_role_to_user_and_project(self, user_id, tenant_id, role_id):
self.resource_api.get_project(tenant_id)

View File

@ -12,18 +12,18 @@
from __future__ import absolute_import
from oslo_config import cfg
from oslo_log import log
from keystone import assignment
from keystone.common import ldap as common_ldap
from keystone.common import models
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone.identity.backends import ldap as ldap_identity
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -17,13 +17,16 @@
import functools
from oslo_config import cfg
from keystone.assignment import controllers
from keystone.common import json_home
from keystone.common import router
from keystone.common import wsgi
from keystone import config
CONF = cfg.CONF
build_os_inherit_relation = functools.partial(
json_home.build_v3_extension_resource_relation,
extension_name='OS-INHERIT', extension_version='1.0')
@ -162,7 +165,7 @@ class Routers(wsgi.RoutersBase):
resource_descriptions=self.v3_resources,
is_entity_implemented=False))
if config.CONF.os_inherit.enabled:
if CONF.os_inherit.enabled:
self._add_resource(
mapper, grant_controller,
path='/OS-INHERIT/domains/{domain_id}/users/{user_id}/roles/'

View File

@ -15,6 +15,7 @@
import sys
from keystoneclient.common import cms
from oslo_config import cfg
from oslo_log import log
from oslo_serialization import jsonutils
from oslo_utils import importutils
@ -33,7 +34,7 @@ from keystone.resource import controllers as resource_controllers
LOG = log.getLogger(__name__)
CONF = config.CONF
CONF = cfg.CONF
# registry of authentication methods
AUTH_METHODS = {}

View File

@ -16,17 +16,17 @@
import abc
from oslo_config import cfg
import six
from keystone import auth
from keystone.common import config
from keystone.common import dependency
from keystone import exception
from keystone.i18n import _
from keystone.openstack.common import versionutils
CONF = config.CONF
CONF = cfg.CONF
@six.add_metaclass(abc.ABCMeta)

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
import six
import sqlalchemy
from sqlalchemy.sql import true
@ -20,11 +21,10 @@ from sqlalchemy.sql import true
from keystone import catalog
from keystone.catalog import core
from keystone.common import sql
from keystone import config
from keystone import exception
CONF = config.CONF
CONF = cfg.CONF
class Region(sql.ModelBase, sql.DictBase):

View File

@ -14,19 +14,19 @@
import os.path
from oslo_config import cfg
from oslo_log import log
import six
from keystone.catalog.backends import kvs
from keystone.catalog import core
from keystone import config
from keystone import exception
from keystone.i18n import _LC
LOG = log.getLogger(__name__)
CONF = config.CONF
CONF = cfg.CONF
def parse_templates(template_lines):

View File

@ -17,6 +17,7 @@
import abc
from oslo_config import cfg
from oslo_log import log
import six
@ -25,14 +26,13 @@ from keystone.common import dependency
from keystone.common import driver_hints
from keystone.common import manager
from keystone.common import utils
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone.i18n import _LE
from keystone import notifications
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)
SHOULD_CACHE = cache.should_cache_fn('catalog')

View File

@ -31,7 +31,7 @@ from keystone import identity
from keystone import token
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -17,15 +17,15 @@
import dogpile.cache
from dogpile.cache import proxy
from dogpile.cache import util
from oslo_config import cfg
from oslo_log import log
from oslo_utils import importutils
from keystone import config
from keystone import exception
from keystone.i18n import _, _LE
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)
make_region = dogpile.cache.make_region

View File

@ -15,6 +15,7 @@
import functools
import uuid
from oslo_config import cfg
from oslo_log import log
import six
@ -23,14 +24,13 @@ from keystone.common import dependency
from keystone.common import driver_hints
from keystone.common import utils
from keystone.common import wsgi
from keystone import config
from keystone import exception
from keystone.i18n import _, _LW
from keystone.models import token_model
LOG = log.getLogger(__name__)
CONF = config.CONF
CONF = cfg.CONF
def v2_deprecated(f):

View File

@ -21,16 +21,16 @@ import time
from dogpile.cache import api
from dogpile.cache.backends import memcached
from oslo_config import cfg
from oslo_log import log
from keystone.common.cache.backends import memcache_pool
from keystone.common import manager
from keystone import config
from keystone import exception
from keystone.i18n import _
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)
NO_VALUE = api.NO_VALUE

View File

@ -22,11 +22,11 @@ from dogpile.cache import proxy
from dogpile.cache import region
from dogpile.cache import util as dogpile_util
from dogpile.core import nameregistry
from oslo_config import cfg
from oslo_log import log
from oslo_utils import importutils
import six
from keystone.common import config
from keystone import exception
from keystone.i18n import _
from keystone.i18n import _LI
@ -38,7 +38,7 @@ __all__ = ['KeyValueStore', 'KeyValueStoreLock', 'LockTimeout',
BACKENDS_REGISTERED = False
CONF = config.CONF
CONF = cfg.CONF
KEY_VALUE_STORE_REGISTRY = weakref.WeakValueDictionary()
LOCK_WINDOW = 1
LOG = log.getLogger(__name__)

View File

@ -15,15 +15,15 @@
import os
from oslo_config import cfg
from oslo_log import log
from keystone.common import environment
from keystone.common import utils
from keystone import config
from keystone.i18n import _LI, _LE
LOG = log.getLogger(__name__)
CONF = config.CONF
CONF = cfg.CONF
PUBLIC_DIR_PERMS = 0o755 # -rwxr-xr-x
PRIVATE_DIR_PERMS = 0o750 # -rwxr-x---

View File

@ -11,17 +11,17 @@
# under the License.
import migrate
from oslo_config import cfg
from oslo_log import log
import sqlalchemy as sql
from sqlalchemy import orm
from keystone.common import sql as ks_sql
from keystone.common.sql import migration_helpers
from keystone import config
LOG = log.getLogger(__name__)
CONF = config.CONF
CONF = cfg.CONF
def upgrade(migrate_engine):

View File

@ -19,6 +19,7 @@ import sys
import migrate
from migrate import exceptions
from oslo_config import cfg
from oslo_db.sqlalchemy import migration
from oslo_serialization import jsonutils
from oslo_utils import importutils
@ -27,13 +28,12 @@ import sqlalchemy
from keystone.common import sql
from keystone.common.sql import migrate_repo
from keystone import config
from keystone import contrib
from keystone import exception
from keystone.i18n import _
CONF = config.CONF
CONF = cfg.CONF
DEFAULT_EXTENSIONS = ['revoke', 'federation']

View File

@ -23,6 +23,7 @@ import hashlib
import os
import pwd
from oslo_config import cfg
from oslo_log import log
from oslo_serialization import jsonutils
from oslo_utils import strutils
@ -30,12 +31,11 @@ import passlib.hash
import six
from six import moves
from keystone.common import config
from keystone import exception
from keystone.i18n import _, _LE, _LW
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -21,6 +21,7 @@
import copy
import urllib
from oslo_config import cfg
import oslo_i18n
from oslo_log import log
from oslo_serialization import jsonutils
@ -31,7 +32,6 @@ import six
import webob.dec
import webob.exc
from keystone.common import config
from keystone.common import dependency
from keystone.common import utils
from keystone import exception
@ -41,7 +41,7 @@ from keystone.i18n import _LW
from keystone.models import token_model
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)
# Environment variable used to pass the request context

View File

@ -16,13 +16,14 @@
import logging
import os
from oslo_config import cfg
from oslo_log import log
from keystone.common import config
from keystone import exception
CONF = config.CONF
CONF = cfg.CONF
setup_authentication = config.setup_authentication
configure = config.configure

View File

@ -12,15 +12,15 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
import six
from keystone.catalog.backends import sql
from keystone.catalog import core as catalog_core
from keystone.common import dependency
from keystone import config
from keystone import exception
CONF = config.CONF
CONF = cfg.CONF
@dependency.requires('endpoint_filter_api')

View File

@ -14,17 +14,17 @@
import abc
from oslo_config import cfg
from oslo_log import log
import six
from keystone.common import dependency
from keystone.common import extension
from keystone.common import manager
from keystone import config
from keystone import exception
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)
extension_data = {

View File

@ -14,16 +14,16 @@
import abc
from oslo_config import cfg
from oslo_log import log
import six
from keystone.common import dependency
from keystone.common import manager
from keystone import config
from keystone import exception
from keystone.i18n import _, _LE, _LW
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -12,13 +12,14 @@
"""Extensions supporting Federation."""
from oslo_config import cfg
from keystone.auth import controllers as auth_controllers
from keystone.common import authorization
from keystone.common import controller
from keystone.common import dependency
from keystone.common import validation
from keystone.common import wsgi
from keystone import config
from keystone.contrib.federation import idp as keystone_idp
from keystone.contrib.federation import schema
from keystone.contrib.federation import utils
@ -27,7 +28,7 @@ from keystone.i18n import _
from keystone.models import token_model
CONF = config.CONF
CONF = cfg.CONF
class _ControllerBase(controller.V3Controller):

View File

@ -14,17 +14,17 @@
import abc
from oslo_config import cfg
from oslo_log import log as logging
import six
from keystone.common import dependency
from keystone.common import extension
from keystone.common import manager
from keystone import config
from keystone import exception
CONF = config.CONF
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
EXTENSION_DATA = {
'name': 'OpenStack Federation APIs',

View File

@ -15,6 +15,7 @@ import os
import subprocess
import uuid
from oslo_config import cfg
from oslo_log import log
from oslo_utils import timeutils
import saml2
@ -24,14 +25,13 @@ from saml2 import samlp
from saml2 import sigver
import xmldsig
from keystone.common import config
from keystone import exception
from keystone.i18n import _, _LE
from keystone.openstack.common import fileutils
LOG = log.getLogger(__name__)
CONF = config.CONF
CONF = cfg.CONF
class SAMLGenerator(object):

View File

@ -15,16 +15,16 @@
import re
import jsonschema
from oslo_config import cfg
from oslo_log import log
from oslo_utils import timeutils
import six
from keystone.common import config
from keystone import exception
from keystone.i18n import _, _LW
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -14,13 +14,13 @@
"""Extensions supporting OAuth1."""
from oslo_config import cfg
from oslo_serialization import jsonutils
from oslo_utils import timeutils
from keystone.common import controller
from keystone.common import dependency
from keystone.common import wsgi
from keystone import config
from keystone.contrib.oauth1 import core as oauth1
from keystone.contrib.oauth1 import validator
from keystone import exception
@ -29,7 +29,7 @@ from keystone.models import token_model
from keystone import notifications
CONF = config.CONF
CONF = cfg.CONF
@notifications.internal(notifications.INVALIDATE_USER_OAUTH_CONSUMER_TOKENS,

View File

@ -22,12 +22,12 @@ import uuid
import oauthlib.common
from oauthlib import oauth1
from oslo_config import cfg
import six
from keystone.common import dependency
from keystone.common import extension
from keystone.common import manager
from keystone import config
from keystone import exception
from keystone import notifications
@ -57,7 +57,7 @@ class Token(object):
self.verifier = verifier
CONF = config.CONF
CONF = cfg.CONF
def token_generator(*args, **kwargs):

View File

@ -12,16 +12,16 @@
import datetime
from oslo_config import cfg
from oslo_utils import timeutils
from keystone.common import kvs
from keystone import config
from keystone.contrib import revoke
from keystone import exception
from keystone.openstack.common import versionutils
CONF = config.CONF
CONF = cfg.CONF
_EVENT_KEY = 'os-revoke-events'
_KVS_BACKEND = 'openstack.kvs.Memory'

View File

@ -13,6 +13,7 @@
import abc
import datetime
from oslo_config import cfg
from oslo_log import log
from oslo_utils import timeutils
import six
@ -21,7 +22,6 @@ from keystone.common import cache
from keystone.common import dependency
from keystone.common import extension
from keystone.common import manager
from keystone import config
from keystone.contrib.revoke import model
from keystone import exception
from keystone.i18n import _
@ -29,7 +29,7 @@ from keystone import notifications
from keystone.openstack.common import versionutils
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -16,17 +16,17 @@
import abc
from oslo_config import cfg
from oslo_log import log
import six
from keystone.common import dependency
from keystone.common import driver_hints
from keystone.common import manager
from keystone import config
from keystone import exception
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -12,15 +12,15 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from oslo_log import log
from oslo_utils import encodeutils
import six
from keystone.common import config
from keystone.i18n import _, _LW
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)
# Tests use this to make exception message format errors fatal

View File

@ -16,6 +16,7 @@ import uuid
import ldap
import ldap.filter
from oslo_config import cfg
from oslo_log import log
import six
@ -23,13 +24,12 @@ from keystone import clean
from keystone.common import driver_hints
from keystone.common import ldap as common_ldap
from keystone.common import models
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone import identity
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -12,9 +12,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from keystone.common import sql
from keystone.common import utils
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone import identity
@ -24,7 +25,7 @@ from keystone import identity
from keystone.resource.backends import sql as resource_sql # noqa
CONF = config.CONF
CONF = cfg.CONF
class User(sql.ModelBase, sql.DictBase):

View File

@ -14,16 +14,16 @@
"""Workflow Logic the Identity service."""
from oslo_config import cfg
from oslo_log import log
from keystone.common import controller
from keystone.common import dependency
from keystone import config
from keystone import exception
from keystone.i18n import _, _LW
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)
@ -126,7 +126,7 @@ class User(controller.V2Controller):
if user_ref['tenantId'] != old_user_ref.get('tenantId'):
if old_user_ref.get('tenantId'):
try:
member_role_id = config.CONF.member_role_id
member_role_id = CONF.member_role_id
self.assignment_api.remove_role_from_user_and_project(
user_id, old_user_ref['tenantId'], member_role_id)
except exception.NotFound:

View File

@ -35,7 +35,7 @@ from keystone.identity.mapping_backends import mapping
from keystone import notifications
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -16,14 +16,14 @@
import abc
from oslo_config import cfg
import six
from keystone.common import dependency
from keystone.common import manager
from keystone import config
from keystone import exception
CONF = config.CONF
CONF = cfg.CONF
@dependency.provider('id_generator_api')

View File

@ -12,20 +12,20 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from oslo_log import log
from oslo_middleware import sizelimit
from oslo_serialization import jsonutils
import six
from keystone.common import authorization
from keystone.common import config
from keystone.common import wsgi
from keystone import exception
from keystone.i18n import _LW
from keystone.models import token_model
from keystone.openstack.common import versionutils
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -13,16 +13,16 @@
"""Unified in-memory token model."""
from keystoneclient.common import cms
from oslo_config import cfg
from oslo_utils import timeutils
import six
from keystone.common import config
from keystone.contrib import federation
from keystone import exception
from keystone.i18n import _
CONF = config.CONF
CONF = cfg.CONF
# supported token versions
V2 = 'v2.0'
V3 = 'v3.0'

View File

@ -17,16 +17,16 @@
import os.path
from oslo_config import cfg
from oslo_log import log
from keystone.common import utils
from keystone import config
from keystone import exception
from keystone.openstack.common import policy as common_policy
from keystone import policy
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -16,16 +16,16 @@
import abc
from oslo_config import cfg
import six
from keystone.common import dependency
from keystone.common import manager
from keystone import config
from keystone import exception
from keystone import notifications
CONF = config.CONF
CONF = cfg.CONF
@dependency.provider('policy_api')

View File

@ -14,20 +14,20 @@ from __future__ import absolute_import
import uuid
from oslo_config import cfg
from oslo_log import log
from keystone import clean
from keystone.common import driver_hints
from keystone.common import ldap as common_ldap
from keystone.common import models
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone.identity.backends import ldap as ldap_identity
from keystone import resource
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -10,17 +10,17 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from oslo_log import log
from keystone import clean
from keystone.common import sql
from keystone import config
from keystone import exception
from keystone.i18n import _LE
from keystone import resource as keystone_resource
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -17,18 +17,18 @@
import uuid
from oslo_config import cfg
from oslo_log import log
from keystone.common import controller
from keystone.common import dependency
from keystone.common import validation
from keystone import config
from keystone import exception
from keystone.i18n import _
from keystone.resource import schema
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)

View File

@ -14,6 +14,7 @@
import abc
from oslo_config import cfg
from oslo_log import log
import six
@ -22,14 +23,13 @@ from keystone.common import cache
from keystone.common import dependency
from keystone.common import driver_hints
from keystone.common import manager
from keystone import config
from keystone.contrib import federation
from keystone import exception
from keystone.i18n import _, _LE
from keystone import notifications
CONF = config.CONF
CONF = cfg.CONF
LOG = log.getLogger(__name__)
SHOULD_CACHE = cache.should_cache_fn('resource')

View File

@ -12,13 +12,15 @@
# under the License.
from oslo_config import cfg
from keystone import backends
from keystone.common import dependency
from keystone.common import sql
from keystone import config
CONF = config.CONF
CONF = cfg.CONF
def configure(version=None, config_files=None):