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

2017-04-05 Thread Akihiro Motoki
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 :
> 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-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2017-04-05 Thread Sam
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-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev