Merge "Fix line-length PEP8 errors for c7fae97" into stable/train
This commit is contained in:
commit
1b967e0aad
|
@ -1818,7 +1818,8 @@ class EnabledEmuMixIn(BaseLdap):
|
|||
naming_rdn[1])
|
||||
self.enabled_emulation_naming_attr = naming_attr
|
||||
|
||||
# TODO(yoctozepto): methods below use _id_to_dn which requests another LDAP connection - optimize it
|
||||
# TODO(yoctozepto): methods below use _id_to_dn which requests another
|
||||
# LDAP connection - optimize it
|
||||
|
||||
def _get_enabled(self, object_id, conn):
|
||||
if self.group_members_are_ids:
|
||||
|
@ -1842,7 +1843,8 @@ class EnabledEmuMixIn(BaseLdap):
|
|||
else:
|
||||
dn = self._id_to_dn(object_id)
|
||||
with self.get_connection() as conn:
|
||||
# TODO(yoctozepto): _get_enabled potentially calls _id_to_dn 2nd time - optimize it
|
||||
# TODO(yoctozepto): _get_enabled potentially calls
|
||||
# _id_to_dn 2nd time - optimize it
|
||||
if not self._get_enabled(object_id, conn):
|
||||
modlist = [(ldap.MOD_ADD,
|
||||
self.member_attribute,
|
||||
|
|
|
@ -2091,9 +2091,10 @@ class LDAPIdentityEnabledEmulation(LDAPIdentity, unit.TestCase):
|
|||
self.assertIs(True, user_ref['enabled'])
|
||||
|
||||
# Ensure state matches the group config
|
||||
group_ref = PROVIDERS.identity_api.get_group_by_name(group_name,
|
||||
CONF.identity.default_domain_id)
|
||||
PROVIDERS.identity_api.check_user_in_group(user_ref['id'], group_ref['id'])
|
||||
group_ref = PROVIDERS.identity_api.get_group_by_name(
|
||||
group_name, CONF.identity.default_domain_id)
|
||||
PROVIDERS.identity_api.check_user_in_group(
|
||||
user_ref['id'], group_ref['id'])
|
||||
|
||||
def test_user_enabled_use_group_config_with_ids(self):
|
||||
# Establish enabled-emulation group name to later query its members
|
||||
|
@ -2124,9 +2125,10 @@ class LDAPIdentityEnabledEmulation(LDAPIdentity, unit.TestCase):
|
|||
self.assertIs(True, user_ref['enabled'])
|
||||
|
||||
# Ensure state matches the group config
|
||||
group_ref = PROVIDERS.identity_api.get_group_by_name(group_name,
|
||||
CONF.identity.default_domain_id)
|
||||
PROVIDERS.identity_api.check_user_in_group(user_ref['id'], group_ref['id'])
|
||||
group_ref = PROVIDERS.identity_api.get_group_by_name(
|
||||
group_name, CONF.identity.default_domain_id)
|
||||
PROVIDERS.identity_api.check_user_in_group(
|
||||
user_ref['id'], group_ref['id'])
|
||||
|
||||
def test_user_enabled_invert(self):
|
||||
self.config_fixture.config(group='ldap', user_enabled_invert=True,
|
||||
|
|
Loading…
Reference in New Issue