mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fixes pylint errors introduced by version 2.4.0.
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
parent
73529e065c
commit
883b44243a
@ -821,7 +821,7 @@ class DomainValidator:
|
||||
|
||||
def string_to_array(what):
|
||||
if six.PY3 and isinstance(what, bytes):
|
||||
return [v for v in what]
|
||||
return list(what)
|
||||
return [ord(v) for v in what]
|
||||
|
||||
|
||||
|
@ -810,10 +810,9 @@ class automember_rebuild(Method):
|
||||
if str(task.single_value['nstaskexitcode']) == '0':
|
||||
summary=task.single_value['nstaskstatus']
|
||||
break
|
||||
else:
|
||||
raise errors.DatabaseError(
|
||||
desc=task.single_value['nstaskstatus'],
|
||||
info=_("Task DN = '%s'" % task_dn))
|
||||
raise errors.DatabaseError(
|
||||
desc=task.single_value['nstaskstatus'],
|
||||
info=_("Task DN = '%s'" % task_dn))
|
||||
time.sleep(1)
|
||||
if time.time() > (start_time + 60):
|
||||
raise errors.TaskTimeout(task=_('Automember'), task_dn=task_dn)
|
||||
|
@ -812,7 +812,7 @@ class LDAPObject(Object):
|
||||
attrlist.append(attr.names[0].lower())
|
||||
json_dict['aciattrs'] = attrlist
|
||||
attrlist.sort()
|
||||
json_dict['methods'] = [m for m in self.methods]
|
||||
json_dict['methods'] = list(self.methods)
|
||||
json_dict['can_have_permissions'] = bool(
|
||||
self.permission_filter_objectclasses)
|
||||
return json_dict
|
||||
|
@ -717,7 +717,7 @@ class DNSRecord(Str):
|
||||
for v in values:
|
||||
if v is None:
|
||||
continue
|
||||
elif isinstance(v, DNSName) and idna:
|
||||
if isinstance(v, DNSName) and idna:
|
||||
v = v.ToASCII()
|
||||
elif not isinstance(v, unicode):
|
||||
v = unicode(v)
|
||||
@ -753,7 +753,7 @@ class DNSRecord(Str):
|
||||
return super(DNSRecord, self)._convert_scalar(value)
|
||||
|
||||
def normalize(self, value):
|
||||
if self.normalizedns:
|
||||
if self.normalizedns: # pylint: disable=using-constant-test
|
||||
if isinstance(value, (tuple, list)):
|
||||
value = tuple(
|
||||
self._normalize_parts(v) for v in value \
|
||||
@ -3439,11 +3439,10 @@ class dnsrecord(LDAPObject):
|
||||
except dns.resolver.NXDOMAIN as e:
|
||||
if nxdomain:
|
||||
continue
|
||||
else:
|
||||
e = errors.DNSDataMismatch(expected=ldap_rrset,
|
||||
got="NXDOMAIN")
|
||||
logger.error('%s', e)
|
||||
raise e
|
||||
e = errors.DNSDataMismatch(expected=ldap_rrset,
|
||||
got="NXDOMAIN")
|
||||
logger.error('%s', e)
|
||||
raise e
|
||||
|
||||
except dns.resolver.NoNameservers as e:
|
||||
# Do not raise exception if we have got SERVFAILs.
|
||||
@ -3848,10 +3847,10 @@ class dnsrecord_del(LDAPUpdate):
|
||||
for option in super(dnsrecord_del, self).get_options():
|
||||
if get_part_rrtype(option.name) or get_extra_rrtype(option.name):
|
||||
continue
|
||||
elif option.name in ('rename', ):
|
||||
if option.name in ('rename', ):
|
||||
# options only valid for dnsrecord-mod
|
||||
continue
|
||||
elif isinstance(option, DNSRecord):
|
||||
if isinstance(option, DNSRecord):
|
||||
yield option.clone(option_group=None)
|
||||
continue
|
||||
yield option
|
||||
@ -3978,7 +3977,7 @@ class dnsrecord_find(LDAPSearch):
|
||||
for option in super(dnsrecord_find, self).get_options():
|
||||
if get_part_rrtype(option.name) or get_extra_rrtype(option.name):
|
||||
continue
|
||||
elif isinstance(option, DNSRecord):
|
||||
if isinstance(option, DNSRecord):
|
||||
yield option.clone(option_group=None)
|
||||
continue
|
||||
yield option
|
||||
|
Loading…
Reference in New Issue
Block a user