Update oslo-incubator apiclient module
Changes - * Removed copyright from empty files * Use encode() instead of strutils.safe_encode() in fake_client * Common ConnectionRefused class Change-Id: Ibb4c0aa26e778d1496e154ee4264d59afcb80ac6
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
# Copyright 2013 OpenStack Foundation
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
@@ -60,6 +60,11 @@ class AuthorizationFailure(ClientException):
|
||||
pass
|
||||
|
||||
|
||||
class ConnectionRefused(ClientException):
|
||||
"""Cannot connect to API service."""
|
||||
pass
|
||||
|
||||
|
||||
class AuthPluginOptionsMissing(AuthorizationFailure):
|
||||
"""Auth plugin misses some options."""
|
||||
def __init__(self, opt_names):
|
||||
|
||||
@@ -31,7 +31,6 @@ import six
|
||||
|
||||
from savannaclient.openstack.common.apiclient import client
|
||||
from savannaclient.openstack.common.py3kcompat import urlutils
|
||||
from savannaclient.openstack.common import strutils
|
||||
|
||||
|
||||
def assert_has_keys(dct, required=[], optional=[]):
|
||||
@@ -64,7 +63,7 @@ class TestResponse(requests.Response):
|
||||
self._content = text
|
||||
default_headers = {}
|
||||
if six.PY3 and isinstance(self._content, six.string_types):
|
||||
self._content = strutils.safe_encode(self._content)
|
||||
self._content = self._content.encode('utf-8', 'strict')
|
||||
self.headers = data.get('headers') or default_headers
|
||||
else:
|
||||
self.status_code = data
|
||||
|
||||
Reference in New Issue
Block a user