Fix E711 comparison to None

Related: https://pagure.io/freeipa/issue/8306
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
Christian Heimes
2020-04-30 14:55:15 +02:00
parent 86d76efcef
commit 9661807385
4 changed files with 10 additions and 9 deletions

View File

@@ -335,8 +335,9 @@ class selinuxusermap_add(LDAPCreate):
entry_attrs['ipaenabledflag'] = 'TRUE'
validate_selinuxuser_inlist(ldap, entry_attrs['ipaselinuxuser'])
# hbacrule is not allowed when usercat or hostcat is set
is_to_be_set = lambda x: x in entry_attrs and entry_attrs[x] != None
def is_to_be_set(x):
"""hbacrule is not allowed when usercat or hostcat is set"""
return x in entry_attrs and entry_attrs[x] is not None
are_local_members_to_be_set = any(is_to_be_set(attr)
for attr in ('usercategory',