trove/trove/tests
Amrith Kumar 577d43b02d insulate TroveContext from possible changes in oslo.context
Earlier code introduced in[1] aimed to handle the situation where a
context object serialized and sent over a message queue as a
dictionary is received by a version of code that doesn't necessarily
understand that context object.

That code relied on the fact that vars(TroveContext).keys() was a
dictionary that matched the full set of parameters that you can send
to the initializers for TroveContext() and RequestContext().

Recent changes in oslo.context [2] and [3] broke that
assumption. vars() on TroveContext provided a dictionary with the
internal representation(s) that are not the same as the kwargs in
RequestContext() and the params that TroveContext used to pop.

To get around this, new code introduced here uses
oslo_utils.reflection to determine all the possible kwargs that can be
sent to TroveContext, some of which are consumed by TroveContext and
the rest of which are sent along to RequestContext().

The construct in the earlier _remove_incompatible_context_args() also
modified kwargs.keys() by pop'ing values from it while iterating over
this. Python 3 takes a dim view of this and therefore some changes
have been made to accomodate this.

A unittest has been added to ensure that the from_dict() method
properly dumps stuff it doesn't know about. The test explicitly
verifies the warning generated when a bogus argument is eliminated.

[1] 24c5e8e244
[2] 2394cff0631944a9259bfe04925e444d9f817758
[3] f25543fcc792ebf155728a91fde06e8dc4e96cea

Change-Id: I477dd29e034295e770925091c4ac6268c22ae59b
Related-Bug:#1661790
2017-02-04 12:07:56 -05:00
..
api Remove negative backup tests from api run 2016-12-21 08:21:40 -08:00
db Remove downgrade 2016-10-06 16:57:41 -05:00
examples Adds the api-ref migrated RST + YAML files 2016-08-17 17:46:41 -04:00
fakes Multi-Region Support 2016-11-04 15:36:16 +00:00
scenario Merge "Add support for cluster restart" 2017-02-03 06:40:25 +00:00
tempest Fix Trove tempest plugin 2016-12-20 12:07:56 +00:00
unittests insulate TroveContext from possible changes in oslo.context 2017-02-04 12:07:56 -05:00
util unwedge the gate 2017-01-29 18:37:11 -05:00
__init__.py Provide option to read SSH credentials from test env 2015-06-30 08:58:34 -04:00
config.py Implement Guest Log File Retrieval 2016-01-26 17:16:02 +00:00
int_tests.py Merge "Add support for cluster restart" 2017-02-03 06:40:25 +00:00
root_logger.py Change reporting of unhandled logging 2015-11-30 19:44:13 -05:00