Fix refreshing VM cache on python3

dict.items() iterator don't like adding/removing items at the same time.
This commit is contained in:
Marek Marczykowski-Górecki 2017-03-01 15:24:36 +01:00
parent 2b1ebba547
commit 5f81b9b809
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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]