summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-05-29 02:13:21 +0000
committerGerrit Code Review <review@openstack.org>2014-05-29 02:13:21 +0000
commit77c8bf982fec4a0d9e1686ee695e96123d32635e (patch)
tree401667cafbb04fe656532385eabd0a4a06dd8758
parentbaa7f373ff3801d78d088adb3db415decc98b38e (diff)
parent54cc999a4def0bcf6faef4da9bc2f7caf131044f (diff)
downloadpython-keystoneclient-77c8bf982fec4a0d9e1686ee695e96123d32635e.tar.gz
Merge "Sync with oslo-incubator caed79d"
-rw-r--r--keystoneclient/openstack/common/apiclient/auth.py4
-rw-r--r--keystoneclient/openstack/common/apiclient/base.py4
-rw-r--r--keystoneclient/openstack/common/apiclient/client.py5
-rw-r--r--keystoneclient/openstack/common/importutils.py4
-rw-r--r--keystoneclient/openstack/common/jsonutils.py10
-rw-r--r--keystoneclient/openstack/common/memorycache.py1
6 files changed, 15 insertions, 13 deletions
diff --git a/keystoneclient/openstack/common/apiclient/auth.py b/keystoneclient/openstack/common/apiclient/auth.py
index 68c7644..e68990d 100644
--- a/keystoneclient/openstack/common/apiclient/auth.py
+++ b/keystoneclient/openstack/common/apiclient/auth.py
@@ -213,8 +213,8 @@ class BaseAuthPlugin(object):
:type service_type: string
:param endpoint_type: Type of endpoint.
Possible values: public or publicURL,
- internal or internalURL,
- admin or adminURL
+ internal or internalURL,
+ admin or adminURL
:type endpoint_type: string
:returns: tuple of token and endpoint strings
:raises: EndpointException
diff --git a/keystoneclient/openstack/common/apiclient/base.py b/keystoneclient/openstack/common/apiclient/base.py
index 2f9b7a4..d958ae1 100644
--- a/keystoneclient/openstack/common/apiclient/base.py
+++ b/keystoneclient/openstack/common/apiclient/base.py
@@ -75,8 +75,8 @@ class HookableMixin(object):
:param cls: class that registers hooks
:param hook_type: hook type, e.g., '__pre_parse_args__'
- :param **args: args to be passed to every hook function
- :param **kwargs: kwargs to be passed to every hook function
+ :param args: args to be passed to every hook function
+ :param kwargs: kwargs to be passed to every hook function
"""
hook_funcs = cls._hooks_map.get(hook_type) or []
for hook_func in hook_funcs:
diff --git a/keystoneclient/openstack/common/apiclient/client.py b/keystoneclient/openstack/common/apiclient/client.py
index 584b187..ed0fbc8 100644
--- a/keystoneclient/openstack/common/apiclient/client.py
+++ b/keystoneclient/openstack/common/apiclient/client.py
@@ -47,6 +47,7 @@ class HTTPClient(object):
"""This client handles sending HTTP requests to OpenStack servers.
Features:
+
- share authentication information between several clients to different
services (e.g., for compute and image clients);
- reissue authentication request for expired tokens;
@@ -152,7 +153,7 @@ class HTTPClient(object):
:param method: method of HTTP request
:param url: URL of HTTP request
:param kwargs: any other parameter that can be passed to
-' requests.Session.request (such as `headers`) or `json`
+ requests.Session.request (such as `headers`) or `json`
that will be encoded as JSON and used as `data` argument
"""
kwargs.setdefault("headers", kwargs.get("headers", {}))
@@ -207,7 +208,7 @@ class HTTPClient(object):
:param method: method of HTTP request
:param url: URL of HTTP request
:param kwargs: any other parameter that can be passed to
-' `HTTPClient.request`
+ `HTTPClient.request`
"""
filter_args = {
diff --git a/keystoneclient/openstack/common/importutils.py b/keystoneclient/openstack/common/importutils.py
index b06fb7c..1261278 100644
--- a/keystoneclient/openstack/common/importutils.py
+++ b/keystoneclient/openstack/common/importutils.py
@@ -24,10 +24,10 @@ import traceback
def import_class(import_str):
"""Returns a class from a string including module and class."""
mod_str, _sep, class_str = import_str.rpartition('.')
+ __import__(mod_str)
try:
- __import__(mod_str)
return getattr(sys.modules[mod_str], class_str)
- except (ValueError, AttributeError):
+ except AttributeError:
raise ImportError('Class %s cannot be found (%s)' %
(class_str,
traceback.format_exception(*sys.exc_info())))
diff --git a/keystoneclient/openstack/common/jsonutils.py b/keystoneclient/openstack/common/jsonutils.py
index 8e646a6..7302ac8 100644
--- a/keystoneclient/openstack/common/jsonutils.py
+++ b/keystoneclient/openstack/common/jsonutils.py
@@ -31,6 +31,7 @@ This module provides a few things:
'''
+import codecs
import datetime
import functools
import inspect
@@ -52,6 +53,7 @@ import six.moves.xmlrpc_client as xmlrpclib
from keystoneclient.openstack.common import gettextutils
from keystoneclient.openstack.common import importutils
+from keystoneclient.openstack.common import strutils
from keystoneclient.openstack.common import timeutils
netaddr = importutils.try_import("netaddr")
@@ -166,12 +168,12 @@ def dumps(value, default=to_primitive, **kwargs):
return json.dumps(value, default=default, **kwargs)
-def loads(s):
- return json.loads(s)
+def loads(s, encoding='utf-8'):
+ return json.loads(strutils.safe_decode(s, encoding))
-def load(fp):
- return json.load(fp)
+def load(fp, encoding='utf-8'):
+ return json.load(codecs.getreader(encoding)(fp))
try:
diff --git a/keystoneclient/openstack/common/memorycache.py b/keystoneclient/openstack/common/memorycache.py
index c02ef8c..a833634 100644
--- a/keystoneclient/openstack/common/memorycache.py
+++ b/keystoneclient/openstack/common/memorycache.py
@@ -22,7 +22,6 @@ from keystoneclient.openstack.common import timeutils
memcache_opts = [
cfg.ListOpt('memcached_servers',
- default=None,
help='Memcached servers or None for in process cache.'),
]