diff --git a/nova/scheduler/host_filter.py b/nova/scheduler/host_filter.py index 7d4b9ad9..9c396cc0 100644 --- a/nova/scheduler/host_filter.py +++ b/nova/scheduler/host_filter.py @@ -97,9 +97,13 @@ class InstanceTypeFilter(HostFilter): """Check that the capabilities provided by the compute service satisfy the extra specs associated with the instance type""" + if 'extra_specs' not in instance_type: + return True + # Note(lorinh): For now, we are just checking exact matching on the # values. Later on, we want to handle numerical # values so we can represent things like number of GPU cards + try: for key, value in instance_type['extra_specs'].iteritems(): if capabilities[key] != value: diff --git a/nova/tests/test_host_filter.py b/nova/tests/test_host_filter.py index 3361c7b7..438f3e52 100644 --- a/nova/tests/test_host_filter.py +++ b/nova/tests/test_host_filter.py @@ -67,7 +67,8 @@ class HostFilterTestCase(test.TestCase): flavorid=1, swap=500, rxtx_quota=30000, - rxtx_cap=200) + rxtx_cap=200, + extra_specs={}) self.zone_manager = FakeZoneManager() states = {}