Cinder Message API create failure "'NoneType' object is not subscriptable"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
In Progress
|
Medium
|
Abhinav Shrivastava |
Bug Description
Tried to create message from cinder message api where 'action' was None.
2023-03-06 03:56:13.919 420861 ERROR oslo_messaging.
2023-03-06 03:56:13.919 420861 ERROR oslo_messaging.
2023-03-06 03:56:13.919 420861 ERROR oslo_messaging.
2023-03-06 03:56:13.919 420861 ERROR oslo_messaging.
2023-03-06 03:56:13.919 420861 ERROR oslo_messaging.
2023-03-06 03:56:13.919 420861 ERROR oslo_messaging.
2023-03-06 03:56:13.919 420861 ERROR oslo_messaging.
2023-03-06 03:56:13.919 420861 ERROR oslo_messaging.
2023-03-06 03:56:13.919 420861 ERROR oslo_messaging.
2023-03-06 03:56:13.919 420861 ERROR oslo_messaging.
2023-03-06 03:56:13.919 420861 ERROR oslo_messaging.
2023-03-06 03:56:13.919 420861 ERROR oslo_messaging.
Changed in cinder: | |
assignee: | nobody → Abhinav Shrivastava (abshriva) |
summary: |
- Cinder Message API failure "'NoneType' object is not subscriptable" + Cinder Message API create failure "'NoneType' object is not + subscriptable" |
Changed in cinder: | |
importance: | Undecided → Medium |
Changing this:
message_ record = {'project_id': context.project_id,
'request_ id': context.request_id,
'resource_ type': resource_type,
'resource_ uuid': resource_uuid,
'action_ id': action[0] if action else '',
'message_ level': level,
'event_ id': "VOLUME_%s_%s_%s" % (resource_type,
action[ 0],
detail_ id),
'detail_ id': detail_id,
'expires_ at': expires_at}
to following fixes the issue:
action_id = action[0] if action else ''
message_ record = {'project_id': context.project_id,
'request_ id': context.request_id,
'resource_ type': resource_type,
'resource_ uuid': resource_uuid,
'action_ id': action_id,
'message_ level': level,
'event_ id': "VOLUME_%s_%s_%s" % (resource_type,
action_ id,
detail_ id),
'detail_ id': detail_id,
'expires_ at': expires_at}