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
-----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
{"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)
This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.
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_ url=keystone_ url,
password= pass,
username= id,
user_ domain_ name='Users' ,
domain_ name='Users'
) Session( auth=auth, verify=self.cert)
self.ksclient = client. Client( session= self.sess)
auth = v3.Password(
self.sess = session.
-----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?
-- /bugs.launchpad .net/bugs/ 1546280
You received this bug notification because you are subscribed to the bug report.
https:/
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-ReadAcces s','password' ,
auth_ url='https:/ /10.210. 21.12:5000/ v3',
cacert= '/home/ btoy/atmos_ cert2.pem' ,projectid= '85bd78a2a77145 a2a6d6a68cb3162 e41'
) volumes. list()
i = cinder.
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": {"passwordCrede ntials" : {"username": "S_Atmos- ReadAccess" , }}}HTTP/ 1.1 404 Not Found
"password": "password"
Date: Tue, 16 Feb 2016 19:41:02 GMT
Server: Apache
Vary: X-Auth-Token
x-openstack- request- id: req-7db54ec5- 0488-4f5f- aa35-8ea3655dfc 42
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): exit(main( )) volumes. list() btoy/PycharmPro jects/Openstack QuotaSync/ cinderclient/ v2/volumes. py", line 294, in list btoy/PycharmPro jects/Openstack QuotaSync/ cinderclient/ base.py" , line 73, in _list client. get(url) btoy/PycharmPro jects/Openstack QuotaSync/ cinderclient/ client. py", line 318, in get request( url, 'GET', **kwargs) btoy/PycharmPro jects/Openstack QuotaSync/ cinderclient/ client. py", line 275, in _cs_request authenticate( ) btoy/PycharmPro jects/Openstack QuotaSync/ cinderclient/ client. py", line 454, in authenticate _v2_auth( auth_url) btoy/PycharmPro jects/Openstack QuotaSync/ cinderclient/ client. py", line 498, in _v2_auth _authenticate( url, body) btoy/PycharmPro jects/Openstack QuotaSync/ cinderclient/ client. py", line 509, in _authenticate redirects= True) btoy/PycharmPro jects/Openstack QuotaSync/ cinderclient/ client. py", line 264, in request from_response( resp, body) exceptions. NotFound: The resource could not be found. (HTTP 404)
File "sessionTest.py", line 40, in <module>
sys.
File "sessionTest.py", line 27, in main
i = cinder.
File "/home/
return self._list(url, resource_type, limit=limit)
File "/home/
resp, body = self.api.
File "/home/
return self._cs_
File "/home/
self.
File "/home/
self.
File "/home/
self.
File "/home/
allow_
File "/home/
raise exceptions.
cinderclient.
To manage notifications about this bug go to: /bugs.launchpad .net/python- cinderclient/ +bug/1546280/ +subscriptions
https:/
This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.