diff --git a/savannaclient/openstack/common/apiclient/__init__.py b/savannaclient/openstack/common/apiclient/__init__.py index f3d0cdef..e69de29b 100644 --- a/savannaclient/openstack/common/apiclient/__init__.py +++ b/savannaclient/openstack/common/apiclient/__init__.py @@ -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. diff --git a/savannaclient/openstack/common/apiclient/exceptions.py b/savannaclient/openstack/common/apiclient/exceptions.py index b364d60d..4776d587 100644 --- a/savannaclient/openstack/common/apiclient/exceptions.py +++ b/savannaclient/openstack/common/apiclient/exceptions.py @@ -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): diff --git a/savannaclient/openstack/common/apiclient/fake_client.py b/savannaclient/openstack/common/apiclient/fake_client.py index 0a72e51f..4824c4f2 100644 --- a/savannaclient/openstack/common/apiclient/fake_client.py +++ b/savannaclient/openstack/common/apiclient/fake_client.py @@ -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