Make servers API use cell-targeted context

This makes the servers API look up the CellMapping for the instance
in question and target the context to the appropriate cell for the
subsequent call into compute/api.

Note that just as with get() and get_all(), we need to avoid going
direct to the cell database and thus short-circuiting the replication
in the case of cellsv1.

Related to blueprint cells-aware-api
Change-Id: If63a4fa7349890a6e7ac0fa3fe12917dc53334d0
This commit is contained in:
Dan Smith 2017-02-13 15:04:44 -08:00 committed by Dan Smith
parent f4bf11842c
commit 153a11e7e5

@ -291,6 +291,9 @@ class SingleCellSimple(fixtures.Fixture):
self.useFixture(fixtures.MonkeyPatch(
'nova.context.target_cell',
self._fake_target_cell))
self.useFixture(fixtures.MonkeyPatch(
'nova.context.set_target_cell',
lambda c, m: None))
def _fake_hostmapping_get(self, *args):
return {'id': 1,