Can not specify auth version of swift client

Asked by chuanyu

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?

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Chmouel Boudjnah (chmouel) said :
#1

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

Revision history for this message
chuanyu (x77126) said :
#2

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 ...

Revision history for this message
Chmouel Boudjnah (chmouel) said :
#3

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

Revision history for this message
chuanyu (x77126) said :
#4

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.

Revision history for this message
Chmouel Boudjnah (chmouel) said :
#5

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

Revision history for this message
chuanyu (x77126) said :
#6

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.

Can you help with this problem?

Provide an answer of your own, or ask chuanyu for more information if necessary.

To post a message you must log in.