mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Cosmetic changes to the code
Fixes some Coverity issues ipadiscovery.py: added assert should universe break plugins/dns.py: removed dead code dnssec/ldapkeydb.py: attribute assert in the proper object test_automount_plugin.py: fixed possible close() on None xmlrpc_test.py: Coverity does not like accessing None.__class__ https://fedorahosted.org/freeipa/ticket/5661 Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
0accf8ccb6
commit
9757384c7c
@@ -402,7 +402,7 @@ class IPADiscovery(object):
|
||||
return [0, thost, lrealms[0]]
|
||||
|
||||
#we shouldn't get here
|
||||
return [UNKNOWN_ERROR]
|
||||
assert False, "Unknown error in ipadiscovery"
|
||||
|
||||
except errors.DatabaseTimeout:
|
||||
root_logger.debug("LDAP Error: timeout")
|
||||
|
||||
@@ -800,9 +800,6 @@ class DNSRecord(Str):
|
||||
if value is None:
|
||||
return
|
||||
|
||||
if value is None:
|
||||
return
|
||||
|
||||
if not self.supported:
|
||||
return _('DNS RR type "%s" is not supported by bind-dyndb-ldap plugin') \
|
||||
% self.rrtype
|
||||
|
||||
@@ -288,7 +288,7 @@ class LdapKeyDB(AbstractHSM):
|
||||
for attr in default_attrs:
|
||||
key.setdefault(attr, default_attrs[attr])
|
||||
|
||||
assert 'ipk11id' in o, 'key is missing ipk11Id in %s' % key.entry.dn
|
||||
assert 'ipk11id' in key, 'key is missing ipk11Id in %s' % key.entry.dn
|
||||
key_id = key['ipk11id']
|
||||
assert key_id not in keys, 'duplicate ipk11Id=0x%s in "%s" and "%s"' % (hexlify(key_id), key.entry.dn, keys[key_id].entry.dn)
|
||||
assert 'ipk11label' in key, 'key "%s" is missing ipk11Label' % key.entry.dn
|
||||
|
||||
@@ -87,6 +87,8 @@ class AutomountTest(XMLRPC_test):
|
||||
break
|
||||
else:
|
||||
current_file.write(line + '\n')
|
||||
assert current_file is not None, ('The input file does not contain any'
|
||||
'records of files to be opened.')
|
||||
current_file.close()
|
||||
|
||||
self.failsafe_add(api.Object.automountlocation, self.locname)
|
||||
|
||||
@@ -357,7 +357,7 @@ class Declarative(XMLRPC_test):
|
||||
if not expected(e, output):
|
||||
raise AssertionError(
|
||||
UNEXPECTED % (cmd, name, args, options,
|
||||
e.__class__.__name__, e)
|
||||
type(e).__name__, e)
|
||||
)
|
||||
|
||||
def check_output(self, nice, cmd, args, options, expected, extra_check):
|
||||
|
||||
Reference in New Issue
Block a user