cinderclient having a problem with keystone v3

Bug #1546280 reported by steweddude
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Medium
wangxiyuan

Bug Description

Don't know if this is a bug or not......but cinderclient seems to be assuming the all keystone auth is v2. Here's the code I'm using:

        cinder = client.Client('2','S_Atmos-ReadAccess','password',
                               auth_url='https://10.210.21.12:5000/v3',
                               cacert='/home/btoy/atmos_cert2.pem',projectid='85bd78a2a77145a2a6d6a68cb3162e41'
                               )
        i = cinder.volumes.list()

Here's the tcp conversation, note the POST:

POST /v3/v2.0/tokens HTTP/1.1

Host: 10.210.23.12:5000

Content-Length: 100

Accept-Encoding: gzip, deflate

Accept: application/json

User-Agent: python-cinderclient

Connection: keep-alive

Content-Type: application/json

{"auth": {"passwordCredentials": {"username": "S_Atmos-ReadAccess", "password": "password"}}}HTTP/1.1 404 Not Found

Date: Tue, 16 Feb 2016 19:41:02 GMT

Server: Apache

Vary: X-Auth-Token

x-openstack-request-id: req-7db54ec5-0488-4f5f-aa35-8ea3655dfc42

Content-Length: 93

Connection: close

Content-Type: application/json

{"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}}

Here's the command line output:

Traceback (most recent call last):
  File "sessionTest.py", line 40, in <module>
    sys.exit(main())
  File "sessionTest.py", line 27, in main
    i = cinder.volumes.list()
  File "/home/btoy/PycharmProjects/OpenstackQuotaSync/cinderclient/v2/volumes.py", line 294, in list
    return self._list(url, resource_type, limit=limit)
  File "/home/btoy/PycharmProjects/OpenstackQuotaSync/cinderclient/base.py", line 73, in _list
    resp, body = self.api.client.get(url)
  File "/home/btoy/PycharmProjects/OpenstackQuotaSync/cinderclient/client.py", line 318, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/home/btoy/PycharmProjects/OpenstackQuotaSync/cinderclient/client.py", line 275, in _cs_request
    self.authenticate()
  File "/home/btoy/PycharmProjects/OpenstackQuotaSync/cinderclient/client.py", line 454, in authenticate
    self._v2_auth(auth_url)
  File "/home/btoy/PycharmProjects/OpenstackQuotaSync/cinderclient/client.py", line 498, in _v2_auth
    self._authenticate(url, body)
  File "/home/btoy/PycharmProjects/OpenstackQuotaSync/cinderclient/client.py", line 509, in _authenticate
    allow_redirects=True)
  File "/home/btoy/PycharmProjects/OpenstackQuotaSync/cinderclient/client.py", line 264, in request
    raise exceptions.from_response(resp, body)
cinderclient.exceptions.NotFound: The resource could not be found. (HTTP 404)

Changed in python-cinderclient:
assignee: nobody → Saiteja Kondepudi (saiteja-kondepudi)
Changed in python-cinderclient:
assignee: Saiteja Kondepudi (saiteja-kondepudi) → nobody
zwei (suifeng20)
Changed in python-cinderclient:
assignee: nobody → zwei (suifeng20)
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote : Owner Expired

Unassigning due to no activity.

Changed in python-cinderclient:
assignee: zwei (suifeng20) → nobody
Changed in python-cinderclient:
status: New → Confirmed
Changed in python-cinderclient:
importance: Undecided → Medium
Revision history for this message
Dilip S M (itzdilip) wrote :

any one has a workaround for this?

Revision history for this message
steweddude (brian-toy) wrote : RE: [Bug 1546280] Re: cinderclient having a problem with keystone v3
Download full text (4.5 KiB)

Try this. And you'll note I'm using a cert.

from keystoneclient.auth.identity import v3
from keystoneclient import session
from keystoneclient.v3 import client
from keystoneauth1 import loading
from keystoneauth1 import session as nvsession

   def __init__(self):

    # Create and config the Keystone client
        auth = v3.Password(
                       auth_url=keystone_url,
                       password=pass,
                       username=id,
                       user_domain_name='Users',
                       domain_name='Users'
                       )
        self.sess = session.Session(auth=auth, verify=self.cert)
        self.ksclient = client.Client(session=self.sess)

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Dilip Sunkum Manjunath
Sent: Tuesday, November 15, 2016 5:11 AM
To: Toy, Brian - NITC, Kansas City, MO <email address hidden>
Subject: [Bug 1546280] Re: cinderclient having a problem with keystone v3

any one has a workaround for this?

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/1546280

Title:
  cinderclient having a problem with keystone v3

Status in python-cinderclient:
  Confirmed

Bug description:
  Don't know if this is a bug or not......but cinderclient seems to be
  assuming the all keystone auth is v2. Here's the code I'm using:

          cinder = client.Client('2','S_Atmos-ReadAccess','password',
                                 auth_url='https://10.210.21.12:5000/v3',
                                 cacert='/home/btoy/atmos_cert2.pem',projectid='85bd78a2a77145a2a6d6a68cb3162e41'
                                 )
          i = cinder.volumes.list()

  Here's the tcp conversation, note the POST:

  POST /v3/v2.0/tokens HTTP/1.1

  Host: 10.210.23.12:5000

  Content-Length: 100

  Accept-Encoding: gzip, deflate

  Accept: application/json

  User-Agent: python-cinderclient

  Connection: keep-alive

  Content-Type: application/json

  {"auth": {"passwordCredentials": {"username": "S_Atmos-ReadAccess",
  "password": "password"}}}HTTP/1.1 404 Not Found

  Date: Tue, 16 Feb 2016 19:41:02 GMT

  Server: Apache

  Vary: X-Auth-Token

  x-openstack-request-id: req-7db54ec5-0488-4f5f-aa35-8ea3655dfc42

  Content-Length: 93

  Connection: close

  Content-Type: application/json

  {"error": {"message": "The resource could not be found.", "code": 404,
  "title": "Not Found"}}

  Here's the command line output:

  Traceback (most recent call last):
    File "sessionTest.py", line 40, in <module>
      sys.exit(main())
    File "sessionTest.py", line 27, in main
      i = cinder.volumes.list()
    File "/home/btoy/PycharmProjects/OpenstackQuotaSync/cinderclient/v2/volumes.py", line 294, in list
      return self._list(url, resource_type, limit=limit)
    File "/home/btoy/PycharmProjects/OpenstackQuotaSync/cinderclient/base.py", line 73, in _list
      resp, body = self.api.client.get(url)
    File "/home/btoy/PycharmProjects/OpenstackQuotaSync/cinderclient/client.py", line ...

Read more...

wangxiyuan (wangxiyuan)
Changed in python-cinderclient:
assignee: nobody → wangxiyuan (wangxiyuan)
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

Testing with the latest code, I think this may have been fixed already by this change:

https://github.com/openstack/python-cinderclient/commit/84af49ce97f481731939344c9c45752ea62db5af

Revision history for this message
wangxiyuan (wangxiyuan) wrote :
Changed in python-cinderclient:
status: Confirmed → In Progress
Revision history for this message
Matthew Edmonds (edmondsw) wrote :

I had previously reported this (and some other issues) as https://bugs.launchpad.net/python-cinderclient/+bug/1424763

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-cinderclient (master)

Reviewed: https://review.openstack.org/404572
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=e1014faed100537c4013142257d90ee24e8344c6
Submitter: Jenkins
Branch: master

commit e1014faed100537c4013142257d90ee24e8344c6
Author: wangxiyuan <email address hidden>
Date: Wed Nov 30 14:36:16 2016 +0800

    Support Keystone V3 with HttpClient

    The http way doesn't work with keystone v3. This patch update the
    HttpClient to support it.

    Closes-bug: #1546280
    Change-Id: Iefa1aafb796609aca076ed6ab73d02c92b9198d0

Changed in python-cinderclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-cinderclient 1.11.0

This issue was fixed in the openstack/python-cinderclient 1.11.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.