From 353d4934afa0e4a83d2458cebeaf362c7ce567e9 Mon Sep 17 00:00:00 2001 From: Stanislav Laznicka Date: Tue, 22 Aug 2017 13:57:16 +0200 Subject: [PATCH] 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 --- ipaserver/plugins/dns.py | 4 ++-- pylintrc | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ipaserver/plugins/dns.py b/ipaserver/plugins/dns.py index 439e00def..1d69cede0 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 8cb86319e..d638b459f 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]