diff --git a/cinder/volume/drivers/vmware/datastore.py b/cinder/volume/drivers/vmware/datastore.py index 61d15d28e69..3f5f126fb5b 100644 --- a/cinder/volume/drivers/vmware/datastore.py +++ b/cinder/volume/drivers/vmware/datastore.py @@ -113,12 +113,10 @@ class DatastoreSelector(object): filtered_summaries = [self._vops.get_summary(ds) for ds in filtered_datastores] - def _filter(summary): - return (summary.freeSpace > size_bytes and + return [summary for summary in filtered_summaries + if (summary.freeSpace > size_bytes and (hard_affinity_ds_types is None or - summary.type.lower() in hard_affinity_ds_types)) - - return filter(_filter, filtered_summaries) + summary.type.lower() in hard_affinity_ds_types))] def _get_all_hosts(self): """Get all ESX hosts managed by vCenter.""" diff --git a/tests-py3.txt b/tests-py3.txt index b4de7284101..4160aac3bd9 100644 --- a/tests-py3.txt +++ b/tests-py3.txt @@ -107,6 +107,7 @@ cinder.tests.unit.test_v6000_fcp cinder.tests.unit.test_v6000_iscsi cinder.tests.unit.test_v7000_common cinder.tests.unit.test_v7000_fcp +cinder.tests.unit.test_vmware_datastore cinder.tests.unit.test_vmware_vmdk cinder.tests.unit.test_vmware_volumeops cinder.tests.unit.test_volume