[openstack-dev] How to get all detail RPC message and detail context in neutron docs?

Akihiro Motoki amotoki at gmail.com
Wed Apr 5 16:27:42 UTC 2017


Hi Sam,

'context' is an object of neutron.context.Context which inherits
oslo_context.RequestContext.
When you see 'context' as a method signature like
router_added_to_agent(self, context, payload),
'context' is Context object.

oslo_messaging serializes the context object and sends to RPC consumer(s).
The serialization conveys the object content to a receiver.

In neutron case, the 'context' object is usually created from keystone
context [1]
or get_admin_context(_without_session) [2].

Does this answer to your question?

[1] https://github.com/openstack/neutron/blob/master/neutron/auth.py#L30
[2] https://github.com/openstack/neutron-lib/blob/master/neutron_lib/context.py#L161


2017-04-05 19:09 GMT+09:00 Sam <batmanustc at gmail.com>:
> Hi all,
>
> I'm working on neutron L3 Agent and some other Agent. I found that there are
> lots of RPCs including RPC call and notification and lots of 'context' as
> bellow. But I don't know its detail context, can I get these from some docs?
>
> If there are no docs, could I get these using some debug method? Like
> '--debug' option or using pdb or something?
>
> RPC: like 'agent_updated' in neutron/neutron/agent/l3/agent.py Line759.
>
> context: it's param in some function like 'def router_added_to_agent(self,
> context, payload):' in neutron/neutron/agent/l3/agent.py.
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>



More information about the OpenStack-dev mailing list