[Openstack] Problem in Nova trying to take data from keystone using v3

Vinod Kumar Boppanna vinod.kumar.boppanna at cern.ch
Fri Feb 7 11:20:15 UTC 2014


Dear Qiu,

Thank you so much. The patch in the first URL is not applicable as i see that the httpclient.py does not resemble the code given there.
But surely, second patch "https://review.openstack.org/#/c/69628/" did wonders and it worked well.

In the mean time, i did a heck like passing a variable from keystoneclient/v3/projects.py all the way to the keystoneclient/httpclient.py
and in the httpclient,py i had checked that if this variable is there, then do not change the management_url to v2 like

from code

def _cs_request(self, url, method, **kwargs):

        if is_management:
            url_to_use = self.management_url

to

def _cs_request(self, url, method, **kwargs):
        management_is = None
        if 'management_is' in kwargs:
            management_is = kwargs['management_is']
            del kwargs['management_is']
        if is_management and (management_is == None):
            url_to_use = self.management_url

This one also worked, but your solution is definitely better than my hack.

Thanks once again,
Regards,
Vinod Kumar Boppanna


________________________________
From: Qiu Yu [unicell at gmail.com]
Sent: 07 February 2014 04:41
To: Vinod Kumar Boppanna
Cc: openstack at lists.openstack.org
Subject: Re: [Openstack] Problem in Nova trying to take data from keystone using v3

Keystoneclient isn't doing very well regarding version negotiation. So my guess on the problem you met is that there're multiple identity service defined in your deployment, and keystoneclient falls back to use default v2.0 for management url.

To fix it, configure only one identity service for v3. Or, apply ugly hacks in keystoneclient, such as

https://review.openstack.org/#/c/62801/
https://review.openstack.org/#/c/69628/

Thanks!
--
Qiu Yu


On Fri, Feb 7, 2014 at 1:04 AM, Vinod Kumar Boppanna <vinod.kumar.boppanna at cern.ch<mailto:vinod.kumar.boppanna at cern.ch>> wrote:
Dear All,

I was trying to get the list of project for a domain in nova by connecting to the keystone using V3 auth tokens, but i am facing problem.

project_list = []
auth_url = "http://<ip of keystone endpoint>:35357/v3/"
keystone = client.Client(token=context.auth_token,
                                 auth_url=auth_url,
                                 project_id = context.project_id)

project_list = keystone.projects.list(domain=context.domain_id)

The first step of authentication is getting successfully completed (as seen in logs)

urllib3.connectionpool [-] "POST /v3/auth/tokens HTTP/1.1" 201 7351 _make_request /usr/lib/python2.6/site-packages/urllib3/connectionpool.py:295

But when it is trying to retrieve the project list, it is using v2 instead of v3 like

GET /v2.0/projects?domain_id=default HTTP/1.1"

The problem is why the keystone client is using v2 for data and v3 for authentication. Should i say some where to use V3 for data as well.

How can i say to use /v3/projects?domain_id=default  instead of v2.0?

Thanks & Regards,
Vinod Kumar Boppanna


_______________________________________________
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to     : openstack at lists.openstack.org<mailto:openstack at lists.openstack.org>
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20140207/cbfaf167/attachment.html>


More information about the Openstack mailing list