Comment 5 for bug 1428728

Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

There are also places like nova/tests/unit/db/test_db_api.py:_create_aggregate which calls get_admin_context() as a default value for an argument to a function.

Tackling all of the places that call get_admin_context() at import time would likely fix the problem at the expense of a lot of work, but it also won't prevent new uses from sneaking in.

I guess clearing out the context is the best short term solution.

We should really rethink how contexts work because side-effects like this are bad.