If an empty compute is restarted a false ERROR message was printed in
the log as the placement report client does not distinguish between
error from placement from empty allocation dict from placement.
This patch changes get_allocations_for_resource_provider to return None
in case of error instead of an empty dict. This is in line with
@safe_connect that would make the call return None as well. The
_error_out_instances_whose_build_was_interrupted also is changed to check
for None instead of empty dict before reporting the ERROR. The only
other caller of get_allocations_for_resource_provider was already
checking for None and converting it to an empty dict so from that caller
perspective this is compatible change on the report client.
This is stable only change as get_allocations_for_resource_provider was
improved during stein[1] to raise on placement error.
[1]I020e7dc47efc79f8907b7bfb753ec779a8da69a1
Conflicts: nova/compute/manager.py
NOTE(mriedem): The conflict and changes to test_compute_mgr.py
are due to not having change I7891b98f225f97ad47f189afb9110ef31c810717
in Pike which added the context argument to method
get_allocations_for_resource_provider.
Change-Id: I6042e493144d4d5a29ec6ab23ffed6b3e7f385fe
Closes-Bug: #1852759
(cherry picked from commit 64f797a0514b0276540d4f6c28cb290383088e35)
(cherry picked from commit 4fcb7816bc88fd513debe70b95aa60bff74e37fb)
Reviewed: https:/ /review. opendev. org/699496 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=511b3b0a446 694dbd9fc97a4b5 a4263b2bfab2fb
Committed: https:/
Submitter: Zuul
Branch: stable/pike
commit 511b3b0a446694d bd9fc97a4b5a426 3b2bfab2fb
Author: Balazs Gibizer <email address hidden>
Date: Fri Nov 15 16:31:04 2019 +0100
Fix false ERROR message at compute restart
If an empty compute is restarted a false ERROR message was printed in
the log as the placement report client does not distinguish between
error from placement from empty allocation dict from placement.
This patch changes get_allocations _for_resource_ provider to return None out_instances_ whose_build_ was_interrupted also is changed to check _for_resource_ provider was already
in case of error instead of an empty dict. This is in line with
@safe_connect that would make the call return None as well. The
_error_
for None instead of empty dict before reporting the ERROR. The only
other caller of get_allocations
checking for None and converting it to an empty dict so from that caller
perspective this is compatible change on the report client.
This is stable only change as get_allocations _for_resource_ provider was
improved during stein[1] to raise on placement error.
[1] I020e7dc47efc79 f8907b7bfb753ec 779a8da69a1
Conflicts:
nova/ compute/ manager. py
NOTE(mriedem): The conflict and changes to test_compute_mgr.py ad47f189afb9110 ef31c810717 allocations_ for_resource_ provider.
are due to not having change I7891b98f225f97
in Pike which added the context argument to method
get_
Change-Id: I6042e493144d4d 5a29ec6ab23ffed 6b3e7f385fe 6540d4f6c28cb29 0383088e35) 13debe70b95aa60 bff74e37fb)
Closes-Bug: #1852759
(cherry picked from commit 64f797a0514b027
(cherry picked from commit 4fcb7816bc88fd5