mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Changing interface dictionary while iterating over interface.keys() produced "RuntimeError: dictionary changed size during iteration"
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user