mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
LGTM: unnecessary else in for loop
for/else makes only sense when the for loop uses break, too. If the for loop simply returns on success, then else is not necessary. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
This commit is contained in:
@@ -3426,8 +3426,7 @@ class dnsrecord(LDAPObject):
|
||||
time.sleep(period)
|
||||
|
||||
# Maximum number of attempts was reached
|
||||
else:
|
||||
raise errors.DNSDataMismatch(expected=ldap_rrset, got=dns_rrset)
|
||||
raise errors.DNSDataMismatch(expected=ldap_rrset, got=dns_rrset)
|
||||
|
||||
def wait_for_modified_attrs(self, entry_attrs, dns_name, dns_domain):
|
||||
'''Wait until DNS resolver returns up-to-date answer for given entry
|
||||
|
||||
@@ -694,6 +694,7 @@ class permission(baseldap.LDAPObject):
|
||||
acientry = ldap.get_entry(location, ['aci'])
|
||||
except errors.NotFound:
|
||||
acientry = ldap.make_entry(location)
|
||||
|
||||
acis = acientry.get('aci', ())
|
||||
for acistring in acis:
|
||||
try:
|
||||
@@ -704,12 +705,12 @@ class permission(baseldap.LDAPObject):
|
||||
continue
|
||||
if aci.name == wanted_aciname:
|
||||
return acientry, acistring
|
||||
else:
|
||||
if notfound_ok:
|
||||
return acientry, None
|
||||
raise errors.NotFound(
|
||||
reason=_('The ACI for permission %(name)s was not found '
|
||||
'in %(dn)s ') % {'name': name, 'dn': location})
|
||||
|
||||
if notfound_ok:
|
||||
return acientry, None
|
||||
raise errors.NotFound(
|
||||
reason=_('The ACI for permission %(name)s was not found '
|
||||
'in %(dn)s ') % {'name': name, 'dn': location})
|
||||
|
||||
def upgrade_permission(self, entry, target_entry=None,
|
||||
output_only=False, cached_acientry=None):
|
||||
|
||||
Reference in New Issue
Block a user