This should give you what you need:

from pecan.core import state
state.controller

On 08/12/14 04:08 PM, Pendergrass, Eric wrote:
> Hi, I'm trying to use the built in secure decorator in Pecan for access 
> control, and I'ld like to get the name of the method that is wrapped from 
> within the decorator.
> 
> For instance, if I'm wrapping MetersController.get_all with an @secure 
> decorator, is there a way for the decorator code to know it was called by 
> MetersController.get_all?
> 
> I don't see any global objects that provide this information.  I can get the 
> endpoint, v2/meters, with pecan.request.path, but that's not as elegant.
> 
> Is there a way to derive the caller or otherwise pass this information to the 
> decorator?
> 
> Thanks
> Eric Pendergrass

> _______________________________________________
> OpenStack-dev mailing list
> [email protected]
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


-- 
Ryan Petrello
Senior Developer, DreamHost
[email protected]

_______________________________________________
OpenStack-dev mailing list
[email protected]
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to