nova/nova/tests
Dan Smith 5d86aa7edb Fix interpretation of max_attempts for scheduling alternates
Since max_attempts is not max_retries, we should look for max_attempts-1
alternate hosts. This change makes the num_alts variable actually reflect
the number of alternates we are looking for, and doesn't actually change
the logic at all. This also adds functional tests to verify max_attempts
behavior with 1 (no retries) and 2 (one retry), just to make sure it is
doing what we expect.

Further, we optimize _get_alternate_hosts() to only re-filter/weigh the
host list if we're looking for alternates for multiple instances. Now
that it's clear that num_alts is only nonzero if we are going to look
at the host list again to find those alternates, it can be more clearly
(and accurately) used to optimize out that extra step if we are not
getting alternates.

Change-Id: I16ba29385dd2db5467829e6c17fc395096b5cfd3
2018-05-18 09:06:07 -07:00
..
functional Fix interpretation of max_attempts for scheduling alternates 2018-05-18 09:06:07 -07:00
live_migration/hooks
unit Fix interpretation of max_attempts for scheduling alternates 2018-05-18 09:06:07 -07:00
__init__.py
fixtures.py Merge "update scheduler to use image-traits" 2018-05-11 22:34:20 +00:00
json_ref.py Nits from Ic3ab7d60e4ac12b767fe70bef97b327545a86e74 2017-11-28 15:55:45 +01:00
uuidsentinel.py