placement/nova/objects
melanie witt 40ad8a2199 Use pick_context_manager throughout DB APIs
The pick_context_manager method will use a connection to a cell
database if one is present in the RequestContext, else it falls
back on the global main_context_manager in the DB API.

Currently, there are several places in our DB API code where
pick_context_manager isn't used because in a real scenario, each
cell is in a separate process where main_context_manager points
to its local database. This causes problems for testing though,
because we are unable to patch the DB API to simulate switching
between multiple 'main' databases in our functional tests because
of the global nature of main_context_manager.

This replaces all uses of main_context_manager with
pick_context_manager to:

  1. Make switching between multiple databases able to work in
     functional tests
  2. Fix any possible cases where pick_context_manager is not
     used for a DB API method that could be called from the
     API using target_cell

Change-Id: I31e3170e0953cefbf49bfc84b29edab514c90cb5
2016-11-18 17:15:51 +00:00
..
aggregate.py Use pick_context_manager throughout DB APIs 2016-11-18 17:15:51 +00:00