nova/nova/scheduler
Eric Fried 683ffb097c refactor: RequestGroup.is_empty() and .strip_zeros()
This makes an is_empty() method on RequestGroup which answers whether
the group has any resources, traits, or aggregates; and a strip_zeros()
method which removes any resources whose amount is zero.

These are used to refactor ResourceRequest.strip_zeros().
_clean_empties() becomes not worth keeping in its own method, so it's
rolled into ResourceRequest.strip_zeros(), its only consumer. At the
same time, the worthless (at least now that we're py3-only)
ResourceRequest.resource_groups() generator is removed and inlined in
the couple of places it was used.

In addition to simply making the code more cohesive, a later patch will
make use of RequestGroup.is_empty() to forbid no-op groups coming from
ports, accelerators, etc.

Change-Id: I6a83b0eb0f1c352f197f2ef8fab124decd537270
2019-12-05 17:02:46 -06:00
..
client Use Placement 1.34 (string suffixes & mappings) 2019-12-05 17:02:46 -06:00
filters Merge "Remove 'hardware.host_topology_and_format_from_host'" 2019-08-23 16:23:31 +00:00
weights hacking: Resolve W503 (line break occurred before a binary operator) 2019-06-24 14:24:06 -05:00
__init__.py Improve hacking rule to avoid author markers 2014-05-05 14:35:20 +02:00
driver.py Remove the CachingScheduler 2018-10-18 17:55:36 -04:00
filter_scheduler.py Remove old comments about caching scheduler compat 2019-09-05 17:20:49 -04:00
host_manager.py Change HostManager to allow scheduling to other cells 2019-08-27 14:26:33 -04:00
manager.py Add support for translating CPU policy extra specs, image meta 2019-09-18 00:21:10 +01:00
request_filter.py Add a new request filter to isolate aggregates 2019-09-12 16:56:32 -05:00
rpcapi.py Use long_rpc_timeout in select_destinations RPC call 2018-11-20 09:03:53 -05:00
utils.py refactor: RequestGroup.is_empty() and .strip_zeros() 2019-12-05 17:02:46 -06:00