[Freeipa-devel] [freeipa PR#121][synchronized] Pylint: enable unused-variable check
URL: https://github.com/freeipa/freeipa/pull/121 Author: mbasti-rh Title: #121: Pylint: enable unused-variable check Action: synchronized To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/121/head:pr121 git checkout pr121 From cd58bc977d4594795cd934d54c22af8115bdce56 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Mon, 26 Sep 2016 14:08:17 +0200 Subject: [PATCH 1/3] Remove unused variables in the code This commit removes unused variables or rename variables as "expected to be unused" by using "_" prefix. This covers only cases where fix was easy or only one unused variable was in a module --- daemons/dnssec/ipa-dnskeysync-replica | 2 +- doc/examples/examples.py| 2 +- install/oddjob/com.redhat.idm.trust-fetch-domains | 2 +- install/share/copy-schema-to-ca.py | 2 +- install/tools/ipa-csreplica-manage | 4 install/tools/ipa-dns-install | 2 +- install/tools/ipa-replica-conncheck | 2 +- ipaclient/ipa_certupdate.py | 2 +- ipaclient/plugins/automount.py | 6 +++--- ipaclient/plugins/location.py | 2 +- ipaclient/plugins/vault.py | 6 -- ipalib/aci.py | 2 -- ipalib/cli.py | 2 +- ipapython/dn.py | 9 - ipapython/dogtag.py | 2 +- ipapython/graph.py | 4 ++-- ipapython/install/cli.py| 2 +- ipapython/install/common.py | 4 ++-- ipapython/nsslib.py | 2 +- ipaserver/install/adtrustinstance.py| 4 ++-- ipaserver/install/installutils.py | 2 +- ipaserver/install/ipa_otptoken_import.py| 2 +- ipaserver/install/krbinstance.py| 2 +- ipaserver/install/ldapupdate.py | 2 +- ipaserver/install/ntpinstance.py| 2 +- ipaserver/install/odsexporterinstance.py| 2 -- ipaserver/install/plugins/adtrust.py| 4 ++-- ipaserver/install/plugins/dns.py| 1 - ipaserver/install/plugins/update_idranges.py| 2 +- ipaserver/install/plugins/update_managed_permissions.py | 2 +- ipaserver/install/plugins/update_passsync.py| 2 +- ipaserver/install/plugins/update_uniqueness.py | 2 +- ipaserver/install/plugins/upload_cacrt.py | 2 +- ipaserver/install/schemaupdate.py | 2 +- ipaserver/install/service.py| 4 ++-- ipaserver/plugins/config.py | 4 ++-- ipaserver/plugins/domainlevel.py| 2 +- ipaserver/plugins/group.py | 2 +- ipaserver/plugins/hbactest.py | 3 ++- ipaserver/plugins/host.py | 2 +- ipaserver/plugins/privilege.py | 2 +- ipaserver/plugins/selinuxusermap.py | 2 +- ipaserver/plugins/server.py | 2 +- ipaserver/plugins/service.py| 2 +- ipaserver/plugins/sudocmd.py| 2 +- ipaserver/session.py| 2 +- makeapi | 2 +- 47 files changed, 54 insertions(+), 69 deletions(-) diff --git a/daemons/dnssec/ipa-dnskeysync-replica b/daemons/dnssec/ipa-dnskeysync-replica index 69a3a68..fbfee93 100755 --- a/daemons/dnssec/ipa-dnskeysync-replica +++ b/daemons/dnssec/ipa-dnskeysync-replica @@ -49,7 +49,7 @@ def update_metadata_set(log, source_set, target_set): def find_unwrapping_key(log, localhsm, wrapping_key_uri): wrap_keys = localhsm.find_keys(uri=wrapping_key_uri) # find usable unwrapping key with matching ID -for key_id, key in wrap_keys.items(): +for key_id in wrap_keys.keys(): unwrap_keys = localhsm.find_keys(id=key_id, cka_unwrap=True) if len(unwrap_keys) > 0: return unwrap_keys.popitem()[1] diff --git a/doc/examples/examples.py b/doc/examples/examples.py index 0ecbf1e..3389230 100644 --- a/doc/examples/examples.py +++ b/doc/examples/examples.py @@ -415,7 +415,7 @@ def execute(self, *args, **options): # patter expects them in one dict. We need to arrange that. for e in entries: e[1]['dn'] = e[0] -entries = [e for (dn, e) in entries] +entries = [e for (_dn, e) in entries] return dict(result=entries, count=len(entries), truncated=truncated) diff --git a/install/oddjob/com.redhat.
[Freeipa-devel] [freeipa PR#121][synchronized] Pylint: enable unused-variable check
URL: https://github.com/freeipa/freeipa/pull/121 Author: mbasti-rh Title: #121: Pylint: enable unused-variable check Action: synchronized To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/121/head:pr121 git checkout pr121 From 3788f4f489d9dc7c54f9239bfe3714fa01e69247 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Mon, 26 Sep 2016 14:08:17 +0200 Subject: [PATCH 1/3] Remove unused variables in the code This commit removes unused variables or rename variables as "expected to be unused" by using "_" prefix. This covers only cases where fix was easy or only one unused variable was in a module --- daemons/dnssec/ipa-dnskeysync-replica | 2 +- doc/examples/examples.py| 2 +- install/oddjob/com.redhat.idm.trust-fetch-domains | 2 +- install/share/copy-schema-to-ca.py | 2 +- install/tools/ipa-csreplica-manage | 4 install/tools/ipa-dns-install | 2 +- install/tools/ipa-replica-conncheck | 2 +- ipaclient/ipa_certupdate.py | 2 +- ipaclient/plugins/automount.py | 6 +++--- ipaclient/plugins/location.py | 2 +- ipaclient/plugins/vault.py | 6 -- ipalib/aci.py | 2 -- ipalib/cli.py | 2 +- ipapython/dn.py | 8 ipapython/dogtag.py | 2 +- ipapython/graph.py | 4 ++-- ipapython/install/cli.py| 2 +- ipapython/install/common.py | 4 ++-- ipapython/nsslib.py | 2 +- ipaserver/install/adtrustinstance.py| 4 ++-- ipaserver/install/installutils.py | 2 +- ipaserver/install/ipa_otptoken_import.py| 2 +- ipaserver/install/krbinstance.py| 2 +- ipaserver/install/ldapupdate.py | 2 +- ipaserver/install/ntpinstance.py| 2 +- ipaserver/install/odsexporterinstance.py| 2 -- ipaserver/install/plugins/adtrust.py| 4 ++-- ipaserver/install/plugins/dns.py| 1 - ipaserver/install/plugins/update_idranges.py| 2 +- ipaserver/install/plugins/update_managed_permissions.py | 2 +- ipaserver/install/plugins/update_passsync.py| 2 +- ipaserver/install/plugins/update_uniqueness.py | 2 +- ipaserver/install/plugins/upload_cacrt.py | 2 +- ipaserver/install/schemaupdate.py | 2 +- ipaserver/install/service.py| 4 ++-- ipaserver/plugins/config.py | 4 ++-- ipaserver/plugins/domainlevel.py| 2 +- ipaserver/plugins/group.py | 2 +- ipaserver/plugins/hbactest.py | 3 ++- ipaserver/plugins/host.py | 2 +- ipaserver/plugins/privilege.py | 2 +- ipaserver/plugins/selinuxusermap.py | 2 +- ipaserver/plugins/server.py | 2 +- ipaserver/plugins/service.py| 2 +- ipaserver/plugins/sudocmd.py| 2 +- ipaserver/session.py| 2 +- makeapi | 2 +- 47 files changed, 54 insertions(+), 68 deletions(-) diff --git a/daemons/dnssec/ipa-dnskeysync-replica b/daemons/dnssec/ipa-dnskeysync-replica index 69a3a68..fbfee93 100755 --- a/daemons/dnssec/ipa-dnskeysync-replica +++ b/daemons/dnssec/ipa-dnskeysync-replica @@ -49,7 +49,7 @@ def update_metadata_set(log, source_set, target_set): def find_unwrapping_key(log, localhsm, wrapping_key_uri): wrap_keys = localhsm.find_keys(uri=wrapping_key_uri) # find usable unwrapping key with matching ID -for key_id, key in wrap_keys.items(): +for key_id in wrap_keys.keys(): unwrap_keys = localhsm.find_keys(id=key_id, cka_unwrap=True) if len(unwrap_keys) > 0: return unwrap_keys.popitem()[1] diff --git a/doc/examples/examples.py b/doc/examples/examples.py index 0ecbf1e..3389230 100644 --- a/doc/examples/examples.py +++ b/doc/examples/examples.py @@ -415,7 +415,7 @@ def execute(self, *args, **options): # patter expects them in one dict. We need to arrange that. for e in entries: e[1]['dn'] = e[0] -entries = [e for (dn, e) in entries] +entries = [e for (_dn, e) in entries] return dict(result=entries, count=len(entries), truncated=truncated) diff --git a/install/oddjob/com.redhat.i