summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2012-03-08 00:07:30 -0800
committerChris Behrens <cbehrens@codestud.com>2012-03-08 08:32:36 -0800
commiteba95d1e42992056edf6f0d6f84e8e230f331cd7 (patch)
tree49a9c7f0ba60fd712c08d7519d7a10b25b7292df /nova/tests
parent10c568aacdb4f2b1eb816097ddfffd6092249f5e (diff)
Add kwargs to RequestContext __init__
Fixes bug 949726 This allows processing of rpc messages that contain older versions of RequestContext to not raise an exception. Change-Id: I4891a44280fcb8accf0cef1c00c1123029abcc96
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_context.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/nova/tests/test_context.py b/nova/tests/test_context.py
index 7fceb2421..ea19dc1f1 100644
--- a/nova/tests/test_context.py
+++ b/nova/tests/test_context.py
@@ -44,3 +44,17 @@ class ContextTestCase(test.TestCase):
'111',
'222',
read_deleted=True)
+
+ def test_extra_args_to_context_get_logged(self):
+ info = {}
+
+ def fake_warn(log_msg):
+ info['log_msg'] = log_msg
+
+ self.stubs.Set(context.LOG, 'warn', fake_warn)
+
+ c = context.RequestContext('user', 'project',
+ extra_arg1='meow', extra_arg2='wuff')
+ self.assertTrue(c)
+ self.assertIn("'extra_arg1': 'meow'", info['log_msg'])
+ self.assertIn("'extra_arg2': 'wuff'", info['log_msg'])