Fix dict iteration bug in dnsrecord_show

In structured mode, dict size is modified by del record[attr].

https://pagure.io/freeipa/issue/7275

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
Christian Heimes 2017-11-22 20:34:57 +01:00
parent 191605efd6
commit f528a44865

View File

@ -3206,7 +3206,7 @@ class dnsrecord(LDAPObject):
def postprocess_record(self, record, **options):
if options.get('structured', False):
for attr in record.keys():
for attr in tuple(record.keys()):
# attributes in LDAPEntry may not be normalized
attr = attr.lower()
try: