Ask Your Question
0

Can not specify auth version of swift client

asked 2012-07-03 08:28:24 -0500

x77126 gravatar image

I followed the swift -h instruction to start my connection, -V AUTH_VERSION, --auth-version=AUTH_VERSION but no matter what I set , the auth version always be set to 2.0 , even not set -V argument..

My swift version: $ aptitude show swift Version: 1.4.8-0ubuntu2

Somebody know what the environment variable or something I missed?

edit retag flag offensive close merge delete

6 answers

Sort by ยป oldest newest most voted
0

answered 2012-07-03 08:42:01 -0500

What are you trying to do? connect to 1.x auth servers ?

edit flag offensive delete link more
0

answered 2012-07-03 09:40:56 -0500

I'd say to report a bug if this happen to you but this seem to work properly with latest version of bin/swift from python-swiftclient

edit flag offensive delete link more
0

answered 2012-07-03 09:29:00 -0500

x77126 gravatar image

but it always use 2.0 even when I don't set -V or --auth-version.

I try to "print >> stderr auth_version" before it return from get_auth() , it shows 2.0 no matter what I set -V 1.0, -V 2.0 or not to set -V.

edit flag offensive delete link more
0

answered 2012-07-03 09:15:56 -0500

by default it will use 1.0 so don't use -V or --auth-version and that should work fine

edit flag offensive delete link more
0

answered 2012-07-03 08:53:38 -0500

x77126 gravatar image

Yes, I've try to connect to 1.0 auth server, and I can connect by curl correctly, and even modifing /usr/bin/swift still works fine,

$ vim /usr/bin/swift <<return v1.0="" auth="" directly="">> 246 def get_auth(url, user, key, snet=False, auth_version="1.0"): """ """ 264 return _get_auth_v1_0(url, user, key, snet) 265 # if auth_version in ["1.0", "1"]: 266 # return _get_auth_v1_0(url, user, key, snet) 267 # elif auth_version in ["2.0", "2"]: 268 # return _get_auth_v2_0(url, user, key, snet)

but, I can't trace where set the auth_version to 2.0 ...

edit flag offensive delete link more
0

answered 2012-07-03 12:59:42 -0500

x77126 gravatar image

I don't know whether latest version of python-swiftclient has the same problem or not, but I noticed that both of they have same code:

< my version /bin/swift > 1868 if (not (options.auth and options.user and options.key) or 1869 environ.get('OS_AUTH_URL')): 1870 # Use 2.0 auth if none of the old args are present 1871 options.auth_version = "2.0"

< latest version of bin/swift > 984 if (not (options.auth and options.user and options.key) or 985 options.os_auth_url): 986 # Use 2.0 auth if none of the old args are present 987 options.auth_version = '2.0'

So, I try to unset OS_AUTH_URL from my environment variable, now my version bin/swift works fine.

Anyway, I think it's a bug that the -V 1.0 I set was not reflect in the result.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2012-07-03 08:28:24 -0500

Seen: 83 times

Last updated: Jul 03 '12