Merge "Remove kwargs 'message' when exception is created"

This commit is contained in:
Zuul 2018-06-11 23:40:36 +00:00 committed by Gerrit Code Review
commit 43bb91e20f
1 changed files with 5 additions and 0 deletions

View File

@ -111,6 +111,11 @@ class CinderException(Exception):
# overshadowed by the class' message attribute
self.msg = message
super(CinderException, self).__init__(message)
# Oslo.messaging use the argument 'message' to rebuild exception
# directly at the rpc client side, therefore we should not use it
# in our keyword arguments, otherwise, the rebuild process will fail
# with duplicate keyword exception.
self.kwargs.pop('message', None)
def _log_exception(self):
# kwargs doesn't match a variable in the message