Fix line-length PEP8 errors for c7fae97

This patch corrects PEP8 failures introduced in c7fae97 that were not
caught by the linter since the check was accidentally disabled. This
patch is backportable. A followup patch will correct the issue for the
whole codebase and re-enable the check.

Change-Id: I1b2413a5d6818f73f721f00ba5c4b610be733b1b
(cherry picked from commit 19d4831daa)
This commit is contained in:
Colleen Murphy 2019-10-18 10:09:12 -07:00 committed by Colleen Murphy
parent 0f6c6061b3
commit a16400f023
2 changed files with 12 additions and 8 deletions

View File

@ -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,

View File

@ -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,