Merge "do not include context to exception notification" into stable/ocata

This commit is contained in:
Jenkins 2017-03-20 10:55:33 +00:00 committed by Gerrit Code Review
commit 6977d26608
2 changed files with 4 additions and 0 deletions

View File

@ -86,6 +86,9 @@ def _get_call_dict(function, self, context, *args, **kw):
# self can't be serialized and shouldn't be in the
# payload
call_dict.pop('self', None)
# NOTE(gibi) remove context as well as it contains sensitive information
# and it can also contain circular references
call_dict.pop('context', None)
return _cleanse_dict(call_dict)

View File

@ -91,6 +91,7 @@ class WrapExceptionTestCase(test.NoDBTestCase):
self.assertEqual(3, notification.payload['args']['extra'])
for key in ['exception', 'args']:
self.assertIn(key, notification.payload.keys())
self.assertNotIn('context', notification.payload['args'].keys())
self.assertEqual(1, len(fake_notifier.VERSIONED_NOTIFICATIONS))
notification = fake_notifier.VERSIONED_NOTIFICATIONS[0]