diff --git a/cinder/context.py b/cinder/context.py index 594c8606831..737646875b9 100644 --- a/cinder/context.py +++ b/cinder/context.py @@ -91,6 +91,9 @@ class RequestContext(context.RequestContext): quota_class=None, service_catalog: Optional[dict] = None, user_auth_plugin=None, + message_resource_id = None, + message_resource_type = None, + message_action = None, **kwargs): """Initialize RequestContext. @@ -117,9 +120,9 @@ class RequestContext(context.RequestContext): timestamp = timeutils.parse_isotime(timestamp) self.timestamp = timestamp self.quota_class = quota_class - self.message_resource_id = None - self.message_resource_type = None - self.message_action = None + self.message_resource_id = message_resource_id + self.message_resource_type = message_resource_type + self.message_action = message_action if service_catalog: # Only include required parts of service_catalog @@ -174,6 +177,9 @@ class RequestContext(context.RequestContext): result['quota_class'] = self.quota_class result['service_catalog'] = self.service_catalog result['request_id'] = self.request_id + result['message_resource_id'] = self.message_resource_id + result['message_resource_type'] = self.message_resource_type + result['message_action'] = self.message_action return result @classmethod @@ -194,6 +200,9 @@ class RequestContext(context.RequestContext): auth_token=values.get('auth_token'), user_domain_id=values.get('user_domain_id'), project_domain_id=values.get('project_domain_id'), + message_resource_id = values.get('message_resource_id'), + message_resource_type = values.get('message_resource_type'), + message_action = values.get('message_action') ) def authorize(self, diff --git a/releasenotes/notes/bug-1978729-cinder-backup-4cd87c4d71b7713e.yaml b/releasenotes/notes/bug-1978729-cinder-backup-4cd87c4d71b7713e.yaml new file mode 100644 index 00000000000..42359b0d2be --- /dev/null +++ b/releasenotes/notes/bug-1978729-cinder-backup-4cd87c4d71b7713e.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + `Bug #1978729 `_: Fixed + context.message_action is None on errors by backup drivers. The message_* + properties of the context were not passed during rpc, which caused a double + exception when a backup driver raised an exception, masking the actual backup + driver exception.