diff options
| author | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-05-05 04:57:25 -0700 |
|---|---|---|
| committer | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-05-05 04:57:25 -0700 |
| commit | cc18ff47ff41ddefd7a31db5b772d55b2e312e8c (patch) | |
| tree | 6fa831f28e4630e1dbd50f363674ccecb706224c /nova/scheduler | |
| parent | 772fc58644871f7ee0bb880074c89d79871e197a (diff) | |
and or test
Diffstat (limited to 'nova/scheduler')
| -rw-r--r-- | nova/scheduler/query.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nova/scheduler/query.py b/nova/scheduler/query.py index 1b84e6b1d..3233cc0d8 100644 --- a/nova/scheduler/query.py +++ b/nova/scheduler/query.py @@ -19,6 +19,10 @@ Three plug-ins are included: AllHosts, Flavor & JSON. AllHosts just returns the full, unfiltered list of hosts. Flavor is a hard coded matching mechanism based on flavor criteria and JSON is an ad-hoc query grammar. + +Note: These are hard filters. All capabilities used must be present +or the host will excluded. If you want soft filters use the weighting +mechanism which is intended for the more touchy-feely capabilities. """ import json @@ -61,7 +65,7 @@ class AllHostsQuery: def filter_hosts(self, zone_manager, query): """Return a list of hosts from ZoneManager list.""" return [(host, services) - for host, services in zone_manager.service_state.iteritems()] + for host, services in zone_manager.service_states.iteritems()] class FlavorQuery: @@ -174,9 +178,6 @@ class JsonQuery: return False return not args[0] - def _must(self, args): - return True - def _or(self, args): return True in args @@ -191,7 +192,6 @@ class JsonQuery: '<=': _less_than_equal, '>=': _greater_than_equal, 'not': _not, - 'must': _must, 'or': _or, 'and': _and, } |
