commit d75b995d03df18164e6338d8b30a7729b52d2133
Author: Matt Riedemann <email address hidden>
Date: Thu May 3 11:21:47 2018 -0400
Handle @safe_connect returns None side effect in _ensure_resource_provider
Change I0c4ca6a81f213277fe7219cb905a805712f81e36 added more error
handling to the _ensure_resource_provider flow but didn't account
for @safe_connect returning None when calling _create_resource_provider
in the case that nova-compute is started before placement is running.
If that happens, we fail with a TypeError during the nova-compute
startup because we put None in the resource provider cache and then
later blindly try to use it because the compute node resource provider
uuid is in the cache, but mapped to None.
This adds the None check back in _ensure_resource_provider and if
None is returned from _create_resource_provider we raise the same
exception that _create_resource_provider would raise if it couldn't
create the provider.
Conflicts:
nova/scheduler/client/report.py: entire method conflicted as
provider_tree changes have not been backported.
nova/tests/unit/scheduler/client/test_report.py - didn't conflict but
referenced non-existant methods. Re-implemented based on
test_ensure_resource_provider_create_fail changing mocked
create_resource_provider to return None instead of raising an exception.
Change-Id: If9e1581db9c1ae14340b787d03c815d243d5a50c
Closes-Bug: #1767139
(cherry picked from commit 80a001989351d3d427c204c8c06cfacc964f2a35)
(cherry picked from commit f95a10b26eb67796a4de32c32afe85c8f6a77048)
Reviewed: https:/ /review. openstack. org/566164 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=d75b995d03d f18164e6338d8b3 0a7729b52d2133
Committed: https:/
Submitter: Zuul
Branch: stable/pike
commit d75b995d03df181 64e6338d8b30a77 29b52d2133
Author: Matt Riedemann <email address hidden>
Date: Thu May 3 11:21:47 2018 -0400
Handle @safe_connect returns None side effect in _ensure_ resource_ provider
Change I0c4ca6a81f2132 77fe7219cb905a8 05712f81e36 added more error resource_ provider flow but didn't account resource_ provider
handling to the _ensure_
for @safe_connect returning None when calling _create_
in the case that nova-compute is started before placement is running.
If that happens, we fail with a TypeError during the nova-compute
startup because we put None in the resource provider cache and then
later blindly try to use it because the compute node resource provider
uuid is in the cache, but mapped to None.
This adds the None check back in _ensure_ resource_ provider and if resource_ provider we raise the same resource_ provider would raise if it couldn't
None is returned from _create_
exception that _create_
create the provider.
Conflicts:
nova/ scheduler/ client/ report. py: entire method conflicted as
provider_tree changes have not been backported.
nova/ tests/unit/ scheduler/ client/ test_report. py - didn't conflict but ensure_ resource_ provider_ create_ fail changing mocked resource_ provider to return None instead of raising an exception.
referenced non-existant methods. Re-implemented based on
test_
create_
Change-Id: If9e1581db9c1ae 14340b787d03c81 5d243d5a50c 427c204c8c06cfa cc964f2a35) 6a4de32c32afe85 c8f6a77048)
Closes-Bug: #1767139
(cherry picked from commit 80a001989351d3d
(cherry picked from commit f95a10b26eb6779