Target context for build notification in conductor
When sending notifications about an instance, it's possible the
notification payload will have attributes not already loaded on
the instance. In this case, a lazy-load will happen and if the
load method needs to lookup the instance (example: in the
_check_instance_exists_in_project method in the DB layer), the
InstanceNotFound exception will be raised and the notification
will fail to be sent.
This targets the instance context to the instance's cell when
calling the send notification method.
NOTE(melwitt): Conflict was due to the older version of target_cell
not yielding a new RequestContext, the absence of set_target_cell,
and an older version of the unit test in Ocata.
Change-Id: I6b9eb120b6e7fcbf919a3791afe2d1f6a7bd3b60
(cherry picked from commit 54cf9f5a90d745896d133669e6d1260e6adee51b)
Reviewed: https:/ /review. openstack. org/511325 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=d7a60f8a1c5 1070237590d975b 1acc61f4bbcfca
Committed: https:/
Submitter: Zuul
Branch: stable/ocata
commit d7a60f8a1c51070 237590d975b1acc 61f4bbcfca
Author: melanie witt <email address hidden>
Date: Thu Oct 5 23:55:58 2017 +0000
Target context for build notification in conductor
When sending notifications about an instance, it's possible the instance_ exists_ in_project method in the DB layer), the Found exception will be raised and the notification
notification payload will have attributes not already loaded on
the instance. In this case, a lazy-load will happen and if the
load method needs to lookup the instance (example: in the
_check_
InstanceNot
will fail to be sent.
This targets the instance context to the instance's cell when
calling the send notification method.
Closes-Bug: #1721670
Conflicts: conductor/ manager. py tests/unit/ conductor/ test_conductor. py
nova/
nova/
NOTE(melwitt): Conflict was due to the older version of target_cell
not yielding a new RequestContext, the absence of set_target_cell,
and an older version of the unit test in Ocata.
Change-Id: I6b9eb120b6e7fc bf919a3791afe2d 1f6a7bd3b60 96d133669e6d126 0e6adee51b)
(cherry picked from commit 54cf9f5a90d7458