Sync latest apiclient from oslo-inc
a908d66 Remove uuidutils 5985b35 Prefer delayed %r formatting over explicit repr use 002999b Curl statements to include globoff for IPv6 URLs 03e6272 Add ConnectionError exception 3bc8231 deprecate apiclient package fd8dc0c Handle different format of api exception a7af1e2 Mask keystone token in debug output 55ca7c3 Split cliutils 5d40e14 Remove code that moved to oslo.i18n 6ff6b4b Switch oslo-incubator to use oslo.utils and remove old modules f76f44c Delete the token and endpoint on expiry of token of client ed0ffb8 Do not incur the cost of a second method call cf449e2 Fix response_key parameter usage in BaseManager 94245b1 Make it possible to get the request_id from python clients d73f3b1 Remove unused/mutable default args 5e00685 Centralize bash-completion in Novaclient 4ef0193 Handle non-openstack errors gracefully ac995be Fix E126 pep8 errors de4adbc pep8: fixed multiple violations e42e77f Restore UUID and human-ID bash completion 9e88af1 fixed typos found by RETF rules 822e09b Don't slugify names that don't exist 4a777e5 Fix warnings in doc build for apiclient 3fb053c apiclient.exceptions.from_response() may miss request_id Btw, the patch removed the uesless 'network_utils' line from openstack-common.conf, currently we use oslo_utils.netutils directly. Change-Id: Ic3d48a13d5366b050b07ef26ab34fad411a0db05 Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
This commit is contained in:
@@ -21,6 +21,19 @@ wrong the tests might raise AssertionError. I've indicated in comments the
|
||||
places where actual behavior differs from the spec.
|
||||
"""
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# THIS MODULE IS DEPRECATED
|
||||
#
|
||||
# Please refer to
|
||||
# https://etherpad.openstack.org/p/kilo-glanceclient-library-proposals for
|
||||
# the discussion leading to this deprecation.
|
||||
#
|
||||
# We recommend checking out the python-openstacksdk project
|
||||
# (https://launchpad.net/python-openstacksdk) instead.
|
||||
#
|
||||
########################################################################
|
||||
|
||||
# W0102: Dangerous default value %s as argument
|
||||
# pylint: disable=W0102
|
||||
|
||||
@@ -33,7 +46,9 @@ from six.moves.urllib import parse
|
||||
from glanceclient.openstack.common.apiclient import client
|
||||
|
||||
|
||||
def assert_has_keys(dct, required=[], optional=[]):
|
||||
def assert_has_keys(dct, required=None, optional=None):
|
||||
required = required or []
|
||||
optional = optional or []
|
||||
for k in required:
|
||||
try:
|
||||
assert k in dct
|
||||
@@ -79,7 +94,7 @@ class FakeHTTPClient(client.HTTPClient):
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.callstack = []
|
||||
self.fixtures = kwargs.pop("fixtures", None) or {}
|
||||
if not args and not "auth_plugin" in kwargs:
|
||||
if not args and "auth_plugin" not in kwargs:
|
||||
args = (None, )
|
||||
super(FakeHTTPClient, self).__init__(*args, **kwargs)
|
||||
|
||||
@@ -166,6 +181,8 @@ class FakeHTTPClient(client.HTTPClient):
|
||||
else:
|
||||
status, body = resp
|
||||
headers = {}
|
||||
self.last_request_id = headers.get('x-openstack-request-id',
|
||||
'req-test')
|
||||
return TestResponse({
|
||||
"status_code": status,
|
||||
"text": body,
|
||||
|
||||
Reference in New Issue
Block a user