683ffb097c
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 |
||
---|---|---|
.. | ||
client | ||
filters | ||
weights | ||
__init__.py | ||
driver.py | ||
filter_scheduler.py | ||
host_manager.py | ||
manager.py | ||
request_filter.py | ||
rpcapi.py | ||
utils.py |