diff options
| author | Ed Leafe <ed@leafe.com> | 2011-08-18 16:22:56 +0000 |
|---|---|---|
| committer | Ed Leafe <ed@leafe.com> | 2011-08-18 16:22:56 +0000 |
| commit | 186987d854fabde120a37713909eaecfbabeaece (patch) | |
| tree | db78852e1207b481ecce3deb66b42d4e8c5810ae | |
| parent | fc7106a5ea476f94c0f832dafebb17181cbe6177 (diff) | |
| download | nova-186987d854fabde120a37713909eaecfbabeaece.tar.gz nova-186987d854fabde120a37713909eaecfbabeaece.tar.xz nova-186987d854fabde120a37713909eaecfbabeaece.zip | |
Corrected the hardcoded filter path. Also simplified the filter matching code in host_filter.py
| -rw-r--r-- | nova/compute/api.py | 3 | ||||
| -rw-r--r-- | nova/scheduler/host_filter.py | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index e909e9959..229d02af4 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -411,12 +411,11 @@ class API(base.Base): LOG.debug(_("Casting to scheduler for %(pid)s/%(uid)s's" " (all-at-once)") % locals()) - filter_class = 'nova.scheduler.host_filter.InstanceTypeFilter' request_spec = { 'image': image, 'instance_properties': base_options, 'instance_type': instance_type, - 'filter': filter_class, + 'filter': 'InstanceTypeFilter' 'blob': zone_blob, 'num_instances': num_instances, } diff --git a/nova/scheduler/host_filter.py b/nova/scheduler/host_filter.py index 4bc5158cc..826a99b0a 100644 --- a/nova/scheduler/host_filter.py +++ b/nova/scheduler/host_filter.py @@ -58,8 +58,6 @@ def choose_host_filter(filter_name=None): if not filter_name: filter_name = FLAGS.default_host_filter for filter_class in _get_filters(): - host_match = "%s.%s" % (filter_class.__module__, filter_class.__name__) - if (host_match.startswith("nova.scheduler.filters") and - (host_match.split(".")[-1] == filter_name)): + if filter_class.__name__ == filter_name: return filter_class() raise exception.SchedulerHostFilterNotFound(filter_name=filter_name) |
