diff options
| author | Yunhong, Jiang <yunhong.jiang@intel.com> | 2012-11-01 11:38:48 +0800 |
|---|---|---|
| committer | Yunhong, Jiang <yunhong.jiang@intel.com> | 2012-11-14 18:44:27 +0800 |
| commit | faba7cf44bcf59d9ac7e342cd4b4d40883341ca5 (patch) | |
| tree | a501355c84d5135bcc0263f92bb8e304afac3d6d /nova | |
| parent | aa2bb87a5e28cb19a0e9244807daacb16f59ce03 (diff) | |
| download | nova-faba7cf44bcf59d9ac7e342cd4b4d40883341ca5.tar.gz nova-faba7cf44bcf59d9ac7e342cd4b4d40883341ca5.tar.xz nova-faba7cf44bcf59d9ac7e342cd4b4d40883341ca5.zip | |
Check instance_type in compute capability filter
Instance type is guaranteed to exist and not be None or empty dict
as a quite a while ago, although it used to be that prep_resize
didn't have it.
Remove the checking for instance_type.
Change-Id: I391615114bd9d9359eeb0b2b3642dcec86a8285e
Signed-off-by: Yunhong, Jiang <yunhong.jiang@intel.com>
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/scheduler/filters/compute_filter.py | 3 | ||||
| -rw-r--r-- | nova/tests/scheduler/test_host_filters.py | 11 |
2 files changed, 0 insertions, 14 deletions
diff --git a/nova/scheduler/filters/compute_filter.py b/nova/scheduler/filters/compute_filter.py index 019068269..93ec7d16e 100644 --- a/nova/scheduler/filters/compute_filter.py +++ b/nova/scheduler/filters/compute_filter.py @@ -28,9 +28,6 @@ class ComputeFilter(filters.BaseHostFilter): def host_passes(self, host_state, filter_properties): """Returns True for only active compute nodes""" - instance_type = filter_properties.get('instance_type') - if not instance_type: - return True capabilities = host_state.capabilities service = host_state.service diff --git a/nova/tests/scheduler/test_host_filters.py b/nova/tests/scheduler/test_host_filters.py index f19755b82..31efc7a36 100644 --- a/nova/tests/scheduler/test_host_filters.py +++ b/nova/tests/scheduler/test_host_filters.py @@ -628,17 +628,6 @@ class HostFiltersTestCase(test.TestCase): 'service': service}) self.assertFalse(filt_cls.host_passes(host, filter_properties)) - def test_compute_filter_passes_on_no_instance_type(self): - self._stub_service_is_up(True) - filt_cls = self.class_map['ComputeFilter']() - filter_properties = {} - capabilities = {'enabled': False} - service = {'disabled': False} - host = fakes.FakeHostState('host1', 'node1', - {'free_ram_mb': 1024, 'capabilities': capabilities, - 'service': service}) - self.assertTrue(filt_cls.host_passes(host, filter_properties)) - def test_image_properties_filter_passes_same_inst_props(self): self._stub_service_is_up(True) filt_cls = self.class_map['ImagePropertiesFilter']() |
