← Back to team overview

openstack team mailing list archive

[Swift]Is the cloudfiles compatible with keystone v2.0?

 

Hello all,
I tried to config the swift using keystone. It seems ok that I use the
swift command:
swift -V 2 -A http://127.0.0.1:5000/v2.0 -U service:swift -K swift stat
   Account: AUTH_a715e6bff8f54a1b85a8a61c0d2be1ca
Containers: 1
   Objects: 0
     Bytes: 0
Accept-Ranges: bytes
X-Timestamp: 1341464397.05768
X-Trans-Id: tx7a6fd2d77e144253a003dab4f6a4fa21

My swift is 1.5.0.
The keystone is the newest version.

I also tried to use python-cloudfiles to access the swift service, but
failed.
conn = cloudfiles.get_connection(
        username='service:swift', api_key='swift', authurl='
http://127.0.0.1:5000/v2.0'
       )
Traceback (most recent call last):
  File "con.py", line 7, in <module>
    username='service:swift', api_key='swift', authurl='
http://127.0.0.1:5000/v2.0'
  File
"/home/alex/workspace/sws/cloudfiles/python-cloudfiles/cloudfiles/__init__.py",
line 98, in get_connection
    return Connection(*args, **kwargs)
  File
"/home/alex/workspace/sws/cloudfiles/python-cloudfiles/cloudfiles/connection.py",
line 85, in __init__
    self._authenticate()
  File
"/home/alex/workspace/sws/cloudfiles/python-cloudfiles/cloudfiles/connection.py",
line 90, in _authenticate
    (url, self.cdn_url, self.token) = self.auth.authenticate()
  File
"/home/alex/workspace/sws/cloudfiles/python-cloudfiles/cloudfiles/authentication.py",
line 78, in authenticate
    raise ResponseError(response.status, response.reason)
cloudfiles.errors.ResponseError: 501: Not Implemented

I found that the swift-client is use the 2.0 compatible api which sent a
json string to kyestone port(5000),
but the cloudfiles use the 1.0 api which sent the 'X-Auth-User' and
'X-Auth-Token' headers to keystone.

If i want use the cloudfiles with the keystone(the newest version), I need
change the code of cloudfiles by myself?

thanks!
-- 
  杨雨
  Email:       alex890714@xxxxxxxxx
GitHub:       https://github.com/AlexYangYu
    Blog:        http://alexyang.sinaapp.com
 Weibo:       http://www.weibo.com/alexyangyu

Follow ups