how to get client's IP in the python API

asked 2015-11-27 09:37:09 -0500

Vini.g.fer gravatar image

I'm trying to implement a new weigher for cells on openstack. How can I get the client IP (the user who is requesting to create a new instance) inside openstack nova python code?

I already have tried

req.remote_addr

inside files nova/api/auth.py (NovaKeystoneContext.__call__ method) and nova/api/compute_req_id.py (ComputeReqIdMiddleware method), but without success. LOG.debug seems to indicate those methods are not called when a new instance creation is requested.

Any suggestions on how can I achieve that?

Thanks

edit retag flag offensive close merge delete