trove/trove/common
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
..
db Fix i18n translation in common 1/5 2016-12-20 12:17:03 +00:00
rpc secure oslo_messaging.rpc 2017-01-11 07:56:35 -05:00
schemas Rename from reddwarf to trove. 2013-06-24 14:11:15 -07:00
strategies Merge "Add support for cluster restart" 2017-02-03 06:40:25 +00:00
__init__.py Remove copyright from empty files 2014-01-16 13:13:23 +04:00
api.py Server support for instance module feature 2016-03-15 12:21:55 -04:00
apischema.py Add support for module ordering on apply 2016-12-26 05:35:39 +00:00
auth.py Python 3: fix relative imports 2016-04-20 15:33:46 +02:00
base_exception.py Correct reraising of exception 2016-07-08 15:03:35 +08:00
base_wsgi.py Python3: Add support for iteritems and iterkeys 2016-04-05 14:32:47 +00:00
cfg.py Add support for cluster restart 2017-01-13 11:41:09 -05:00
configurations.py Implement configuration management for DB2 2016-09-08 00:47:32 -07:00
context.py insulate TroveContext from possible changes in oslo.context 2017-02-04 12:07:56 -05:00
crypto_utils.py secure oslo_messaging.rpc 2017-01-11 07:56:35 -05:00
debug_utils.py initial chkin of pylint 2016-09-14 13:56:24 -04:00
exception.py Add support for Oslo Policies to Trove 2016-12-06 21:51:21 +00:00
extensions.py Remove cfg and logging import unused 2016-09-23 16:38:10 +00:00
glance_remote.py Multi-Region Support 2016-11-04 15:36:16 +00:00
i18n.py Drop use of 'oslo' namespace package 2015-05-06 20:01:57 +00:00
instance.py Implement Guest Log File Retrieval 2016-01-26 17:16:02 +00:00
limits.py Add i18n translation to common 2/5 2016-12-20 12:16:52 +00:00
local.py Remove openstack.common package 2015-07-23 19:54:04 +03:00
models.py Add i18n translation to common 2/5 2016-12-20 12:16:52 +00:00
notification.py Add support for cluster restart 2017-01-13 11:41:09 -05:00
pagination.py Port pagination on Python 3 2016-08-31 18:12:49 -04:00
pastedeploy.py Trivial: Remove vim header from source files 2015-12-30 17:30:49 +08:00
policy.py Add support for Oslo Policies to Trove 2016-12-06 21:51:21 +00:00
profile.py Cleanup i18n marker functions to match Oslo usage 2016-07-12 12:41:19 +00:00
remote.py unwedge the gate 2017-01-29 18:37:11 -05:00
serializable_notification.py Implement DBaaS Ceilometer Notifications 2016-02-27 00:16:28 +00:00
server_group.py Remove cfg and logging import unused 2016-09-23 16:38:10 +00:00
single_tenant_remote.py Multi-Region Support 2016-11-04 15:36:16 +00:00
stream_codecs.py Fix SafeConfigParser DeprecationWarning in Python 3.2 2016-10-01 09:55:54 +00:00
template.py Implement configuration management for DB2 2016-09-08 00:47:32 -07:00
trove_remote.py Multi-Region Support 2016-11-04 15:36:16 +00:00
utils.py Implement full online backups for DB2 2016-09-13 20:35:01 +00:00
views.py Remove extraneous vim configuration comments 2014-02-27 15:05:21 +08:00
wsgi.py Add support for Oslo Policies to Trove 2016-12-06 21:51:21 +00:00
xmlutils.py Add i18n tranlastion to common 3/5 2016-12-20 12:16:57 +00:00