Comment 1 for bug 2009483

Revision history for this message
Abhinav Shrivastava (abshriva) wrote : Re: Cinder Message API failure "'NoneType' object is not subscriptable"

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}