From 06f3aad5cf26b36e40abd0dd5fc547690c5c5b3d Mon Sep 17 00:00:00 2001 From: Stanislav Laznicka Date: Sep 12 2017 10:20:42 +0000 Subject: pylint: Iterate through dictionaries The consider-iterating-dictionary check disable never worked before (notice the missing comma in pylintrc). Fix the rest of the dict iteration. https://pagure.io/freeipa/issue/6874 Reviewed-By: Alexander Bokovoy Reviewed-By: Florence Blanc-Renaud --- diff --git a/ipaserver/plugins/dns.py b/ipaserver/plugins/dns.py index 439e00d..1d69ced 100644 --- a/ipaserver/plugins/dns.py +++ b/ipaserver/plugins/dns.py @@ -2920,7 +2920,7 @@ class dnszone_find(DNSZoneBase_find): if options.get('forward_only', False): search_kw = {} search_kw['idnsname'] = [revzone.ToASCII() for revzone in - REVERSE_DNS_ZONES.keys()] + REVERSE_DNS_ZONES] rev_zone_filter = ldap.make_filter(search_kw, rules=ldap.MATCH_NONE, exact=False, @@ -3094,7 +3094,7 @@ class dnsrecord(LDAPObject): if not zone_len: allowed_zones = ', '.join([unicode(revzone) for revzone in - REVERSE_DNS_ZONES.keys()]) + REVERSE_DNS_ZONES]) raise errors.ValidationError(name='ptrrecord', error=unicode(_('Reverse zone for PTR record should be a sub-zone of one the following fully qualified domains: %s') % allowed_zones)) diff --git a/pylintrc b/pylintrc index 8cb8631..d638b45 100644 --- a/pylintrc +++ b/pylintrc @@ -93,7 +93,6 @@ disable= redefined-argument-from-local, # new in pylint 1.7 consider-merging-isinstance, # new in pylint 1.7 unsupported-assignment-operation # new in pylint 1.7 - consider-iterating-dictionary, # wontfix for better python2/3 code [REPORTS]