Merge "Store config in drivers and use it to get list_limit"
This commit is contained in:
commit
554c71e5cf
@ -41,9 +41,11 @@ class Identity(identity.IdentityDriverV8):
|
||||
def __init__(self, conf=None):
|
||||
super(Identity, self).__init__()
|
||||
if conf is None:
|
||||
conf = CONF
|
||||
self.user = UserApi(conf)
|
||||
self.group = GroupApi(conf)
|
||||
self.conf = CONF
|
||||
else:
|
||||
self.conf = conf
|
||||
self.user = UserApi(self.conf)
|
||||
self.group = GroupApi(self.conf)
|
||||
|
||||
def default_assignment_driver(self):
|
||||
return 'ldap'
|
||||
|
@ -76,6 +76,7 @@ class Identity(identity.IdentityDriverV8):
|
||||
# NOTE(henry-nash): Override the __init__() method so as to take a
|
||||
# config parameter to enable sql to be used as a domain-specific driver.
|
||||
def __init__(self, conf=None):
|
||||
self.conf = conf
|
||||
super(Identity, self).__init__()
|
||||
|
||||
def default_assignment_driver(self):
|
||||
|
@ -1165,8 +1165,15 @@ class Manager(manager.Manager):
|
||||
class IdentityDriverV8(object):
|
||||
"""Interface description for an Identity driver."""
|
||||
|
||||
def _get_conf(self):
|
||||
try:
|
||||
return self.conf or CONF
|
||||
except AttributeError:
|
||||
return CONF
|
||||
|
||||
def _get_list_limit(self):
|
||||
return CONF.identity.list_limit or CONF.list_limit
|
||||
conf = self._get_conf()
|
||||
return conf.identity.list_limit or conf.list_limit
|
||||
|
||||
def is_domain_aware(self):
|
||||
"""Indicates if Driver supports domains."""
|
||||
|
Loading…
Reference in New Issue
Block a user