Fix refreshing VM cache on python3
dict.items() iterator don't like adding/removing items at the same time.
This commit is contained in:
parent
2b1ebba547
commit
5f81b9b809
@ -63,7 +63,7 @@ class VMCollection(object):
|
||||
[vm_prop.split('=', 1) for vm_prop in props])
|
||||
|
||||
self._vm_list = new_vm_list
|
||||
for name, vm in self._vm_objects.items():
|
||||
for name, vm in list(self._vm_objects.items()):
|
||||
if vm.name not in self._vm_list:
|
||||
# VM no longer exists
|
||||
del self._vm_objects[name]
|
||||
|
Loading…
Reference in New Issue
Block a user