Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylint fixes #97

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
pylint: fix redefine-in-handler
  • Loading branch information
Jan Barta authored and MartinBasti committed Sep 22, 2016
commit 06f35e5bdcb9f3ea42145de253674fda06b43d30
14 changes: 7 additions & 7 deletions install/tools/ipa-csreplica-manage
Expand Up @@ -190,9 +190,9 @@ def del_link(realm, replica1, replica2, dirman_passwd, force=False):

# Find the DN of the replication agreement to remove
replica2_dn = None
for e in repl_list:
if e.single_value.get('nsDS5ReplicaHost') == replica1:
replica2_dn = e.dn
for entry in repl_list:
if entry.single_value.get('nsDS5ReplicaHost') == replica1:
replica2_dn = entry.dn
break

# This should never happen
Expand All @@ -203,8 +203,8 @@ def del_link(realm, replica1, replica2, dirman_passwd, force=False):
print("'%s' has no replication agreement for '%s'" % (replica2, replica1))
if not force:
return
except Exception as e:
print("Failed to get data from '%s': %s" % (replica2, e))
except Exception as exc:
print("Failed to get data from '%s': %s" % (replica2, exc))
if not force:
sys.exit(1)

Expand All @@ -213,8 +213,8 @@ def del_link(realm, replica1, replica2, dirman_passwd, force=False):
try:
repl2.delete_agreement(replica1, replica2_dn)
repl2.delete_referral(replica1, repl1.port)
except Exception as e:
print("Unable to remove agreement on %s: %s" % (replica2, e))
except Exception as exc:
print("Unable to remove agreement on %s: %s" % (replica2, exc))
failed = True

if failed:
Expand Down
10 changes: 5 additions & 5 deletions ipaserver/plugins/baseldap.py
Expand Up @@ -2035,9 +2035,9 @@ def sort_key(x):
entries.sort(key=sort_key)

if not options.get('raw', False):
for e in entries:
self.obj.get_indirect_members(e, attrs_list)
self.obj.convert_attribute_members(e, *args, **options)
for entry in entries:
self.obj.get_indirect_members(entry, attrs_list)
self.obj.convert_attribute_members(entry, *args, **options)

for (i, e) in enumerate(entries):
entries[i] = entry_to_dict(e, **options)
Expand All @@ -2051,9 +2051,9 @@ def sort_key(x):

try:
ldap.handle_truncated_result(truncated)
except errors.LimitsExceeded as e:
except errors.LimitsExceeded as exc:
add_message(options['version'], result, SearchResultTruncated(
reason=e))
reason=exc))

return result

Expand Down
1 change: 0 additions & 1 deletion pylintrc
Expand Up @@ -51,7 +51,6 @@ disable=
no-init,
pointless-string-statement,
protected-access,
redefine-in-handler,
redefined-builtin,
redefined-outer-name,
super-init-not-called,
Expand Down