Swift authentification probelm

asked 2015-09-19 02:24:39 -0600

ArKocharyan gravatar image

Hello everyone, I am a team member of research group and my current research needs to use Openstack Swift. We have installed Openstack Juno and it works perfectly. For installation Packstack have used used. The swift service is also installed on the server and it works! We have tried to access it from the console create container, upload a file etc. everything works. So we went further and tried to access swift using its API. Here we faced a problem on the phase of authentication.

Below you can see the simple python code I am using to check if I can connect to Swift.

import swiftclient
import keystoneclient 

conn = swiftclient.Connection(
            authurl='http://*[server ip]*:5000/v2.0/',

for container in conn.get_account()[1]:
       print container['name']

Before executing the cod I have installed the following necessary packages.

sudo aptitude install python-pip
sudo pip install python-swiftclient
sudo pip install python-keystoneclient

Here you can see the error which occurs during execution of the code.

Traceback (most recent call last):
  File "new.py", line 15, in <module>
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 1332, in get_auth
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 463, in get_auth
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 366, in get_auth_keystone
    ksclient, exceptions = _import_keystone_client(auth_version)
  File "/usr/local/lib/python2.7/dist-packages/swiftclient/client.py", line 351, in _import_keystone_client
    variables to be set or overridden with -A, -U, or -K.''')
Auth versions 2.0 and 3 require python-keystoneclient, install it or use Auth
version 1.0 which requires ST_AUTH, ST_USER, and ST_KEY environment
variables to be set or overridden with -A, -U, or -K.

I have tried to find the solution searching in the Internet but I have not succeed. Thank you in advance!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-10-29 06:18:52 -0600

ArKocharyan gravatar image

It is sad that nooene tried to help me, but in any case is someone will face the same problem, I just removed "python-swiftclient" and "python-keystoneclient " packages and everything worked.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-09-19 02:24:39 -0600

Seen: 1,271 times

Last updated: Oct 29 '15