summaryrefslogtreecommitdiff
path: root/openstackclient/common/clientmanager.py
diff options
context:
space:
mode:
authorJosh Kearney <josh@jk0.org>2013-01-31 13:31:41 -0600
committerJosh Kearney <josh@jk0.org>2013-01-31 13:31:41 -0600
commitb26cb5bf683e7f4f03d9704524a188b76ac5e9b9 (patch)
treef059ddb3b7e15f50d722cf1fbd2b0eaf8242b1a4 /openstackclient/common/clientmanager.py
parentaa4f12aec1d13d02df2ecc2710d85ebd90d6dfe7 (diff)
downloadpython-openstackclient-b26cb5bf683e7f4f03d9704524a188b76ac5e9b9.tar.gz
Upgraded to PEP8 1.3.3 to stay aligned with Nova, etc.
Made all the necessary changes to pass new PEP8 standards. Also cleaned up docstrings to conform to the HACKING stanards. Change-Id: Ib8df3030da7a7885655689ab5da0717748c9edbe
Diffstat (limited to 'openstackclient/common/clientmanager.py')
-rw-r--r--openstackclient/common/clientmanager.py25
1 files changed, 8 insertions, 17 deletions
diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py
index f6f6642e..830ecde7 100644
--- a/openstackclient/common/clientmanager.py
+++ b/openstackclient/common/clientmanager.py
@@ -13,8 +13,7 @@
# under the License.
#
-"""Manage access to the clients, including authenticating when needed.
-"""
+"""Manage access to the clients, including authenticating when needed."""
import logging
@@ -22,13 +21,12 @@ from openstackclient.compute import client as compute_client
from openstackclient.identity import client as identity_client
from openstackclient.image import client as image_client
+
LOG = logging.getLogger(__name__)
class ClientCache(object):
- """Descriptor class for caching created client handles.
- """
-
+ """Descriptor class for caching created client handles."""
def __init__(self, factory):
self.factory = factory
self._handle = None
@@ -41,20 +39,14 @@ class ClientCache(object):
class ClientManager(object):
- """Manages access to API clients, including authentication.
- """
-
+ """Manages access to API clients, including authentication."""
compute = ClientCache(compute_client.make_client)
identity = ClientCache(identity_client.make_client)
image = ClientCache(image_client.make_client)
- def __init__(self, token=None, url=None,
- auth_url=None,
- tenant_name=None, tenant_id=None,
- username=None, password=None,
- region_name=None,
- api_version=None,
- ):
+ def __init__(self, token=None, url=None, auth_url=None, tenant_name=None,
+ tenant_id=None, username=None, password=None,
+ region_name=None, api_version=None):
self._token = token
self._url = url
self._auth_url = auth_url
@@ -74,8 +66,7 @@ class ClientManager(object):
return
def get_endpoint_for_service_type(self, service_type):
- """Return the endpoint URL for the service type.
- """
+ """Return the endpoint URL for the service type."""
# See if we are using password flow auth, i.e. we have a
# service catalog to select endpoints from
if self._service_catalog: