Remote connect to Swift with tempauth with python-cloudfiles

I had a setup with Swift on a server, Ubuntu 11.10 and OpenStack Diablo, and I could do curls-commands to it.

However, when trying to use python-cloudfiles and swift-cli from a remote machine, it just returned Errno 111: Connection Refused all the time.

After days with googling, I finally got the nerve to visit the openstack irc channel, and after about half an hour with troubleshooting, they provided me with the answer that I need to have an url for the callback under the tempauth filter in proxy-server.conf-file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

[DEFAULT]
bind_port = 8080
user = swift
log_facility = LOG_LOCAL1

[pipeline:main]
pipeline = healthcheck cache tempauth proxy-server

[app:proxy-server]
use = egg:swift
#proxy allow_account_management = true
account_autocreate = true

[filter:tempauth]
use = egg:swift#tempauth
user_admin_admin = admin .admin [[http://<swift-ip>:8080/v1/AUTH_callback]] # the url is needed
user_test_tester = testing .admin

[filter:healthcheck]
use = egg:swift#healthcheck

[filter:cache]
use = egg:swift#memcache

Now, connecting with cloudfiles works like a charm:

1
2
3
4

import cloudfiles
conn = cloudfiles.get_connection("admin:admin","admin",authurl="<swift-ip>/auth/v1.0")
conn.connection_args[0] '<swift-ip>'
Share