keystone notification context is empty

Bug #1420688 reported by Guangya Liu (Jay Lau)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
Steve Martinelli

Bug Description

When keystone send notification, the context will be set as {}, this caused some problem when related component such as nova to deseralize the context

2015-01-28 13:01:40.391 20150 ERROR oslo.messaging.notify.dispatcher [-] Exception during message handling
2015-01-28 13:01:40.391 20150 TRACE oslo.messaging.notify.dispatcher Traceback (most recent call last):
2015-01-28 13:01:40.391 20150 TRACE oslo.messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/oslo/messaging/notify/dispatcher.py", line 87, in _dispatch_and_handle_error
2015-01-28 13:01:40.391 20150 TRACE oslo.messaging.notify.dispatcher return self._dispatch(incoming.ctxt, incoming.message)
2015-01-28 13:01:40.391 20150 TRACE oslo.messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/oslo/messaging/notify/dispatcher.py", line 103, in _dispatch
2015-01-28 13:01:40.391 20150 TRACE oslo.messaging.notify.dispatcher ctxt = self.serializer.deserialize_context(ctxt)
2015-01-28 13:01:40.391 20150 TRACE oslo.messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/nova/rpc.py", line 117, in deserialize_context
2015-01-28 13:01:40.391 20150 TRACE oslo.messaging.notify.dispatcher return nova.context.RequestContext.from_dict(context)
2015-01-28 13:01:40.391 20150 TRACE oslo.messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/nova/context.py", line 179, in from_dict
2015-01-28 13:01:40.391 20150 TRACE oslo.messaging.notify.dispatcher return cls(**values)
2015-01-28 13:01:40.391 20150 TRACE oslo.messaging.notify.dispatcher TypeError: __init__() takes at least 3 arguments (1 given)
2015-01-28 13:01:40.391 20150 TRACE oslo.messaging.notify.dispatcher

We should at least set project_id and user_id to context.

https://github.com/openstack/keystone/blob/master/keystone/notifications.py#L241

Revision history for this message
Morgan Fainberg (mdrnstm) wrote :
Changed in keystone:
assignee: nobody → Steve Martinelli (stevemar)
importance: Undecided → Low
milestone: none → kilo-3
status: New → Fix Committed
Revision history for this message
Steve Martinelli (stevemar) wrote :

thanks morgan, it's worth mentioning that the user_id and project_id are available if the cadf notification format is used.

user_id = payload.initiator.id
project_id = payload.initiator.project_id
domain_id = payload.initiator.domain_id

Revision history for this message
Guangya Liu (Jay Lau) (jay-lau-513) wrote :

Cool!

Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: kilo-3 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.