qmemman: fix list/filter handling on python3

Filter in python3 returns a generator, can be iterated only once.
This is about list of existing domains - store it as a list, otherwise
domains will "disappear" after being discovered.
This commit is contained in:
Marek Marczykowski-Górecki 2017-05-18 09:44:48 +02:00
parent 58e58e0ca7
commit 0ef010cc70
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -103,13 +103,13 @@ class XS_Watcher(object):
# check if domain is really there, it may happen that some empty
# directories are left in xenstore
curr = filter(
curr = list(filter(
lambda x:
self.handle.read('',
'/local/domain/{}/domid'.format(x)
) is not None,
curr
)
))
self.log.debug('curr={!r}'.format(curr))
for i in only_in_first_list(curr, self.watch_token_dict.keys()):