mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
parent
86d76efcef
commit
9661807385
@ -801,7 +801,7 @@ class SimpleServiceInstance(Service):
|
||||
|
||||
def __enable(self):
|
||||
self.backup_state("enabled", self.is_enabled())
|
||||
if self.gensvc_name == None:
|
||||
if self.gensvc_name is None:
|
||||
self.enable()
|
||||
else:
|
||||
self.ldap_configure(self.gensvc_name, self.fqdn, None, self.suffix)
|
||||
|
@ -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',
|
||||
|
@ -136,7 +136,7 @@ class test_Fuzzy:
|
||||
|
||||
assert (False == self.klass()) is True
|
||||
assert (True == self.klass()) is True
|
||||
assert (None == self.klass()) is True
|
||||
assert (None == self.klass()) is True # noqa
|
||||
|
||||
|
||||
def test_assert_deepequal(pytestconfig):
|
||||
|
@ -132,9 +132,9 @@ class test_hbactest(XMLRPC_test):
|
||||
nodetail=True
|
||||
)
|
||||
assert ret['value'] == True
|
||||
assert ret['error'] == None
|
||||
assert ret['matched'] == None
|
||||
assert ret['notmatched'] == None
|
||||
assert ret['error'] is None
|
||||
assert ret['matched'] is None
|
||||
assert ret['notmatched'] is None
|
||||
|
||||
def test_c_hbactest_check_rules_enabled_detail(self):
|
||||
"""
|
||||
@ -181,8 +181,8 @@ class test_hbactest(XMLRPC_test):
|
||||
)
|
||||
|
||||
assert ret['value'] == False
|
||||
assert ret['matched'] == None
|
||||
assert ret['notmatched'] == None
|
||||
assert ret['matched'] is None
|
||||
assert ret['notmatched'] is None
|
||||
for rule in self.rule_names:
|
||||
assert u'%s_1x1' % (rule) in ret['error']
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user