Modify filters so they can look to HostState

Now that HostState is updated with aggregates, we can change all the filters so they
are looking at it instead of calling the AggregateList objects.

That's the final patch of the series, hurrah.

Implements: blueprint isolate-scheduler-db

Change-Id: Id2e9533eaaedd237902e20b0279e58c6deb24681
This commit is contained in:
Sylvain Bauza 2015-02-27 17:09:54 +01:00 committed by Joe Gordon
parent afa7abc13b
commit d7408278e3
3 changed files with 3 additions and 9 deletions

View File

@ -48,9 +48,7 @@ class AggregateImagePropertiesIsolation(filters.BaseHostFilter):
spec = filter_properties.get('request_spec', {})
image_props = spec.get('image', {}).get('properties', {})
context = filter_properties['context']
metadata = utils.aggregate_metadata_get_by_host(context,
host_state.host)
metadata = utils.aggregate_metadata_get_by_host(host_state)
for key, options in metadata.iteritems():
if (cfg_namespace and

View File

@ -42,9 +42,7 @@ class AggregateInstanceExtraSpecsFilter(filters.BaseHostFilter):
if 'extra_specs' not in instance_type:
return True
context = filter_properties['context']
metadata = utils.aggregate_metadata_get_by_host(context,
host_state.host)
metadata = utils.aggregate_metadata_get_by_host(host_state)
for key, req in instance_type['extra_specs'].iteritems():
# Either not scope format, or aggregate_instance_extra_specs scope

View File

@ -40,9 +40,7 @@ class AggregateMultiTenancyIsolation(filters.BaseHostFilter):
props = spec.get('instance_properties', {})
tenant_id = props.get('project_id')
context = filter_properties['context']
metadata = utils.aggregate_metadata_get_by_host(context,
host_state.host,
metadata = utils.aggregate_metadata_get_by_host(host_state,
key="filter_tenant_id")
if metadata != {}: