summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.rst9
-rw-r--r--keystoneclient/client.py4
-rw-r--r--keystoneclient/shell.py14
-rw-r--r--keystoneclient/v2_0/client.py2
-rw-r--r--keystoneclient/v2_0/tokens.py6
5 files changed, 17 insertions, 18 deletions
diff --git a/README.rst b/README.rst
index 5cb0f2e..eff5f30 100644
--- a/README.rst
+++ b/README.rst
@@ -27,7 +27,7 @@ By way of a quick-start::
# use v2.0 auth with http://example.com:5000/v2.0")
>>> from keystoneclient.v2_0 import client
- >>> keystone = client.Client(user_name=USERNAME, password=PASSWORD, tenant_name=TENANT, auth_url=KEYSTONE_URL)
+ >>> keystone = client.Client(username=USERNAME, password=PASSWORD, tenant_name=TENANT, auth_url=KEYSTONE_URL)
>>> keystone.tenants.list()
>>> tenant = keystone.tenants.create(name="test", descrption="My new tenant!", enabled=True)
>>> tenant.delete()
@@ -49,7 +49,7 @@ with the ``--username``, ``--apikey`` and ``--projectid`` params, but it's
easier to just set them as environment variables::
export OS_TENANT_NAME=project
- export OS_USER_NAME=user
+ export OS_USERNAME=user
export OS_PASSWORD=pass
You will also need to define the authentication url with ``--url`` and the
@@ -66,7 +66,7 @@ can specify the one you want with ``--region_name`` (or
You'll find complete documentation on the shell by running
``keystone help``::
- usage: keystone [--user_name user] [--password password]
+ usage: keystone [--username user] [--password password]
[--tenant_name tenant] [--auth_url URL]
<subcommand> ...
@@ -78,8 +78,7 @@ You'll find complete documentation on the shell by running
Optional arguments:
- --user_name USER Defaults to env[OS_USER_NAME].
- --user_id USERID Defaults to env[OS_USER_ID].
+ --username USER Defaults to env[OS_USERNAME].
--password PASSWORD Defaults to env[OS_PASSWORD].
--tenant_name TENANT Defaults to env[OS_TENANT_NAME].
--tenant_id TENANTID Defaults to env[OS_TENANT_].
diff --git a/keystoneclient/client.py b/keystoneclient/client.py
index aad2446..a29e34a 100644
--- a/keystoneclient/client.py
+++ b/keystoneclient/client.py
@@ -38,11 +38,11 @@ class HTTPClient(httplib2.Http):
USER_AGENT = 'python-keystoneclient'
- def __init__(self, user_name=None, tenant_id=None, tenant_name=None,
+ def __init__(self, username=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_name = user_name
+ self.username = username
self.tenant_id = tenant_id
self.tenant_name = tenant_name
self.password = password
diff --git a/keystoneclient/shell.py b/keystoneclient/shell.py
index 01f53c4..9232d14 100644
--- a/keystoneclient/shell.py
+++ b/keystoneclient/shell.py
@@ -55,9 +55,9 @@ class OpenStackIdentityShell(object):
action='store_true',
help=argparse.SUPPRESS)
- parser.add_argument('--user_name',
- default=env('OS_USER_NAME'),
- help='Defaults to env[OS_USER_NAME].')
+ parser.add_argument('--username',
+ default=env('OS_USERNAME'),
+ help='Defaults to env[OS_USERNAME].')
parser.add_argument('--password',
default=env('OS_PASSWORD'),
@@ -151,9 +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_name:
- raise exc.CommandError("You must provide a user name:"
- "via --user_name or env[OS_USER_NAME]")
+ if not args.username:
+ raise exc.CommandError("You must provide a username:"
+ "via --username or env[OS_USERNAME]")
if not args.password:
raise exc.CommandError("You must provide a password, either"
"via --password or env[OS_PASSWORD]")
@@ -163,7 +163,7 @@ class OpenStackIdentityShell(object):
"via --auth_url or via"
"env[OS_AUTH_URL")
- self.cs = self.get_api_class(options.version)(user_name=args.user_name,
+ self.cs = self.get_api_class(options.version)(username=args.username,
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 1dee548..627634c 100644
--- a/keystoneclient/v2_0/client.py
+++ b/keystoneclient/v2_0/client.py
@@ -86,7 +86,7 @@ class Client(client.HTTPClient):
"""
self.management_url = self.auth_url
# try:
- raw_token = self.tokens.authenticate(user_name=self.user_name,
+ raw_token = self.tokens.authenticate(username=self.username,
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 a79c1a5..0b3c579 100644
--- a/keystoneclient/v2_0/tokens.py
+++ b/keystoneclient/v2_0/tokens.py
@@ -21,12 +21,12 @@ class Token(base.Resource):
class TokenManager(base.ManagerWithFind):
resource_class = Token
- def authenticate(self, user_name=None, tenant_id=None, tenant_name=None,
+ def authenticate(self, username=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,
+ elif username and password:
+ params = {"auth": {"passwordCredentials": {"username": username,
"password": password}}}
else:
raise ValueError('A username and password or token is required.')