From e2d98e58447e9375706a4d33777cc4ed326380a7 Mon Sep 17 00:00:00 2001 From: Joe Heck Date: Thu, 10 Nov 2011 08:51:12 -0800 Subject: [PATCH] pep8 cleanup --- keystoneclient/v2_0/client.py | 15 ++++++++++----- keystoneclient/v2_0/users.py | 16 +++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/keystoneclient/v2_0/client.py b/keystoneclient/v2_0/client.py index 314a3a677..21bc4c70a 100644 --- a/keystoneclient/v2_0/client.py +++ b/keystoneclient/v2_0/client.py @@ -38,16 +38,20 @@ class Client(client.HTTPClient): :param string auth_url: Keystone service endpoint for authorization. :param string region_name: Name of a region to select when choosing an endpoint from the service catalog. - :param string endpoint: A user-supplied endpoint URL for the keystone service. - Lazy-authentication is possible for API service calls - if endpoint is set at instantiation.(optional) + :param string endpoint: A user-supplied endpoint URL for the keystone + service. Lazy-authentication is possible for API + service calls if endpoint is set at + instantiation.(optional) :param integer timeout: Allows customization of the timeout for client http requests. (optional) Example:: >>> from keystoneclient.v2_0 import client - >>> keystone = client.Client(username=USER, password=PASS, project_id=TENANT, auth_url=KEYSTONE_URL) + >>> keystone = client.Client(username=USER, + password=PASS, + project_id=TENANT, + auth_url=KEYSTONE_URL) >>> keystone.tenants.list() ... >>> user = keystone.users.get(USER_ID) @@ -94,7 +98,8 @@ class Client(client.HTTPClient): raise except Exception, e: _logger.exception("Authorization Failed.") - raise exceptions.AuthorizationFailure("Authorization Failed: %s" % e) + raise exceptions.AuthorizationFailure("Authorization Failed: " + "%s" % e) def _extract_service_catalog(self, url, body): """ Set the client's service catalog from the response data. """ diff --git a/keystoneclient/v2_0/users.py b/keystoneclient/v2_0/users.py index c44939e40..60451535c 100644 --- a/keystoneclient/v2_0/users.py +++ b/keystoneclient/v2_0/users.py @@ -37,7 +37,7 @@ class UserManager(base.ManagerWithFind): """ # FIXME(ja): why do we have to send id in params and url? params = {"user": {"id": base.getid(user), - "email": email }} + "email": email}} return self._update("/users/%s" % base.getid(user), params, "user") @@ -46,7 +46,7 @@ class UserManager(base.ManagerWithFind): Update enabled-ness """ params = {"user": {"id": base.getid(user), - "enabled": enabled }} + "enabled": enabled}} self._update("/users/%s/enabled" % base.getid(user), params, "user") @@ -55,26 +55,28 @@ class UserManager(base.ManagerWithFind): Update password """ params = {"user": {"id": base.getid(user), - "password": password }} + "password": password}} - return self._update("/users/%s/password" % base.getid(user), params, "user") + return self._update("/users/%s/password" % base.getid(user), + params, "user") def update_tenant(self, user, tenant): """ Update default tenant. """ params = {"user": {"id": base.getid(user), - "tenantId": base.getid(tenant) }} + "tenantId": base.getid(tenant)}} # FIXME(ja): seems like a bad url - default tenant is an attribute # not a subresource!??? - return self._update("/users/%s/tenant" % base.getid(user), params, "user") + return self._update("/users/%s/tenant" % base.getid(user), + params, "user") def create(self, name, password, email, tenant_id=None, enabled=True): """ Create a user. """ - # FIXME(ja): email should be optional but keystone currently requires it + # FIXME(ja): email should be optional, keystone currently requires it params = {"user": {"name": name, "password": password, "tenantId": tenant_id,