diff options
author | Jesse Andrews <anotherjesse@gmail.com> | 2011-12-17 22:28:31 -0800 |
---|---|---|
committer | Jesse Andrews <anotherjesse@gmail.com> | 2011-12-17 22:28:31 -0800 |
commit | 0f392a58c33aba4b7e6a6801a2a1e2f38066b57f (patch) | |
tree | d48849d74d5249e1e1bb70f17aa83734f6ad08c3 | |
parent | cfbebeeae036f0c7db6c99f5e0c328469967da0d (diff) | |
download | python-keystoneclient-0f392a58c33aba4b7e6a6801a2a1e2f38066b57f.tar.gz |
remove user_id as you shouldn't auth using it
-rw-r--r-- | keystoneclient/client.py | 8 | ||||
-rw-r--r-- | keystoneclient/shell.py | 12 | ||||
-rw-r--r-- | keystoneclient/v2_0/client.py | 1 | ||||
-rw-r--r-- | keystoneclient/v2_0/tokens.py | 7 |
4 files changed, 8 insertions, 20 deletions
diff --git a/keystoneclient/client.py b/keystoneclient/client.py index 94d9c94..aad2446 100644 --- a/keystoneclient/client.py +++ b/keystoneclient/client.py @@ -38,12 +38,10 @@ class HTTPClient(httplib2.Http): USER_AGENT = 'python-keystoneclient' - def __init__(self, user_name=None, user_id=None, - tenant_id=None, tenant_name=None, password=None, - project_id=None, auth_url=None, region_name=None, - timeout=None, endpoint=None, token=None): + def __init__(self, user_name=None, tenant_id=None, tenant_name=None, + password=None, project_id=None, auth_url=None, + region_name=None, timeout=None, endpoint=None, token=None): super(HTTPClient, self).__init__(timeout=timeout) - self.user_id = user_id self.user_name = user_name self.tenant_id = tenant_id self.tenant_name = tenant_name diff --git a/keystoneclient/shell.py b/keystoneclient/shell.py index 0fb9840..01f53c4 100644 --- a/keystoneclient/shell.py +++ b/keystoneclient/shell.py @@ -59,10 +59,6 @@ class OpenStackIdentityShell(object): default=env('OS_USER_NAME'), help='Defaults to env[OS_USER_NAME].') - parser.add_argument('--user_id', - default=env('OS_USER_ID'), - help='Defaults to env[OS_USER_ID].') - parser.add_argument('--password', default=env('OS_PASSWORD'), help='Defaults to env[OS_PASSWORD].') @@ -155,10 +151,9 @@ class OpenStackIdentityShell(object): #FIXME(usrleon): Here should be restrict for project id same as # for username or apikey but for compatibility it is not. - if not args.user_id and not args.user_name: - raise exc.CommandError("You must provide a user name or id:" - "via --user_name or env[OS_USER_NAME]" - "via --user_id or env[OS_USER_ID])") + if not args.user_name: + raise exc.CommandError("You must provide a user name:" + "via --user_name or env[OS_USER_NAME]") if not args.password: raise exc.CommandError("You must provide a password, either" "via --password or env[OS_PASSWORD]") @@ -169,7 +164,6 @@ class OpenStackIdentityShell(object): "env[OS_AUTH_URL") self.cs = self.get_api_class(options.version)(user_name=args.user_name, - user_id=args.user_id, tenant_name=args.tenant_name, tenant_id=args.tenant_id, password=args.password, diff --git a/keystoneclient/v2_0/client.py b/keystoneclient/v2_0/client.py index c9dc6d5..1dee548 100644 --- a/keystoneclient/v2_0/client.py +++ b/keystoneclient/v2_0/client.py @@ -87,7 +87,6 @@ class Client(client.HTTPClient): self.management_url = self.auth_url # try: raw_token = self.tokens.authenticate(user_name=self.user_name, - user_id=self.user_id, tenant_id=self.tenant_id, tenant_name=self.tenant_name, password=self.password, diff --git a/keystoneclient/v2_0/tokens.py b/keystoneclient/v2_0/tokens.py index a369801..a79c1a5 100644 --- a/keystoneclient/v2_0/tokens.py +++ b/keystoneclient/v2_0/tokens.py @@ -21,16 +21,13 @@ class Token(base.Resource): class TokenManager(base.ManagerWithFind): resource_class = Token - def authenticate(self, user_name=None, user_id=None, tenant_id=None, - tenant_name=None, password=None, token=None, return_raw=False): + def authenticate(self, user_name=None, tenant_id=None, tenant_name=None, + password=None, token=None, return_raw=False): if token and token != password: params = {"auth": {"token": {"id": token}}} elif user_name and password: params = {"auth": {"passwordCredentials": {"username": user_name, "password": password}}} - elif user_id and password: - params = {"auth": {"passwordCredentials": {"userId": user_id, - "password": password}}} else: raise ValueError('A username and password or token is required.') if tenant_id: |