Sync with oslo-incubator caed79d

This syncs python-keystoneclient with oslo-incubator commit hash
caed79d8239679cb74476bb0d9e5011b4fcc39da

First, remove the existing code to cleanup:
 $ rm -r keystoneclient/openstack/*

Then, sync from oslo-incubator:
 $ python update.py ../python-keystoneclient

Commits since last sync (2640847):
----------------------------------
1173e46 Remove ValueError when accessing sys.modules
90ae24b Remove redundant default=None for config options
18f2bc1 Enforce unicode json output for jsonutils.load[s]()
4a777e5 Fix warnings in doc build for apiclient

Related-Bug: #1315523
Closes-Bug: #1314129
Change-Id: Id53ea2d4828e81bc6270f186849f391e7bc73101
This commit is contained in:
Steve Martinelli
2014-05-27 13:53:58 -04:00
parent 7c608309d6
commit 54cc999a4d
6 changed files with 15 additions and 13 deletions

View File

@@ -213,8 +213,8 @@ class BaseAuthPlugin(object):
:type service_type: string :type service_type: string
:param endpoint_type: Type of endpoint. :param endpoint_type: Type of endpoint.
Possible values: public or publicURL, Possible values: public or publicURL,
internal or internalURL, internal or internalURL,
admin or adminURL admin or adminURL
:type endpoint_type: string :type endpoint_type: string
:returns: tuple of token and endpoint strings :returns: tuple of token and endpoint strings
:raises: EndpointException :raises: EndpointException

View File

@@ -75,8 +75,8 @@ class HookableMixin(object):
:param cls: class that registers hooks :param cls: class that registers hooks
:param hook_type: hook type, e.g., '__pre_parse_args__' :param hook_type: hook type, e.g., '__pre_parse_args__'
:param **args: args 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 :param kwargs: kwargs to be passed to every hook function
""" """
hook_funcs = cls._hooks_map.get(hook_type) or [] hook_funcs = cls._hooks_map.get(hook_type) or []
for hook_func in hook_funcs: for hook_func in hook_funcs:

View File

@@ -47,6 +47,7 @@ class HTTPClient(object):
"""This client handles sending HTTP requests to OpenStack servers. """This client handles sending HTTP requests to OpenStack servers.
Features: Features:
- share authentication information between several clients to different - share authentication information between several clients to different
services (e.g., for compute and image clients); services (e.g., for compute and image clients);
- reissue authentication request for expired tokens; - reissue authentication request for expired tokens;
@@ -152,7 +153,7 @@ class HTTPClient(object):
:param method: method of HTTP request :param method: method of HTTP request
:param url: URL of HTTP request :param url: URL of HTTP request
:param kwargs: any other parameter that can be passed to :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 that will be encoded as JSON and used as `data` argument
""" """
kwargs.setdefault("headers", kwargs.get("headers", {})) kwargs.setdefault("headers", kwargs.get("headers", {}))
@@ -207,7 +208,7 @@ class HTTPClient(object):
:param method: method of HTTP request :param method: method of HTTP request
:param url: URL of HTTP request :param url: URL of HTTP request
:param kwargs: any other parameter that can be passed to :param kwargs: any other parameter that can be passed to
' `HTTPClient.request` `HTTPClient.request`
""" """
filter_args = { filter_args = {

View File

@@ -24,10 +24,10 @@ import traceback
def import_class(import_str): def import_class(import_str):
"""Returns a class from a string including module and class.""" """Returns a class from a string including module and class."""
mod_str, _sep, class_str = import_str.rpartition('.') mod_str, _sep, class_str = import_str.rpartition('.')
__import__(mod_str)
try: try:
__import__(mod_str)
return getattr(sys.modules[mod_str], class_str) return getattr(sys.modules[mod_str], class_str)
except (ValueError, AttributeError): except AttributeError:
raise ImportError('Class %s cannot be found (%s)' % raise ImportError('Class %s cannot be found (%s)' %
(class_str, (class_str,
traceback.format_exception(*sys.exc_info()))) traceback.format_exception(*sys.exc_info())))

View File

@@ -31,6 +31,7 @@ This module provides a few things:
''' '''
import codecs
import datetime import datetime
import functools import functools
import inspect import inspect
@@ -52,6 +53,7 @@ import six.moves.xmlrpc_client as xmlrpclib
from keystoneclient.openstack.common import gettextutils from keystoneclient.openstack.common import gettextutils
from keystoneclient.openstack.common import importutils from keystoneclient.openstack.common import importutils
from keystoneclient.openstack.common import strutils
from keystoneclient.openstack.common import timeutils from keystoneclient.openstack.common import timeutils
netaddr = importutils.try_import("netaddr") netaddr = importutils.try_import("netaddr")
@@ -166,12 +168,12 @@ def dumps(value, default=to_primitive, **kwargs):
return json.dumps(value, default=default, **kwargs) return json.dumps(value, default=default, **kwargs)
def loads(s): def loads(s, encoding='utf-8'):
return json.loads(s) return json.loads(strutils.safe_decode(s, encoding))
def load(fp): def load(fp, encoding='utf-8'):
return json.load(fp) return json.load(codecs.getreader(encoding)(fp))
try: try:

View File

@@ -22,7 +22,6 @@ from keystoneclient.openstack.common import timeutils
memcache_opts = [ memcache_opts = [
cfg.ListOpt('memcached_servers', cfg.ListOpt('memcached_servers',
default=None,
help='Memcached servers or None for in process cache.'), help='Memcached servers or None for in process cache.'),
] ]