1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Changing interface dictionary while iterating over interface.keys() produced "RuntimeError: dictionary changed size during iteration"
This commit is contained in:
Selivanov Pavel 2018-04-22 11:03:31 +03:00 committed by ansibot
parent 56967497d5
commit b47c04a70e

View file

@ -789,7 +789,7 @@ def main():
if not force or not interfaces: if not force or not interfaces:
for interface in copy.deepcopy(exist_interfaces): for interface in copy.deepcopy(exist_interfaces):
# remove values not used during hostinterface.add/update calls # remove values not used during hostinterface.add/update calls
for key in interface.keys(): for key in tuple(interface.keys()):
if key in ['interfaceid', 'hostid', 'bulk']: if key in ['interfaceid', 'hostid', 'bulk']:
interface.pop(key, None) interface.pop(key, None)