diff --git a/heatclient/common/http.py b/heatclient/common/http.py index 3282e2a..ee45037 100644 --- a/heatclient/common/http.py +++ b/heatclient/common/http.py @@ -19,6 +19,7 @@ import os import socket import requests +import six from heatclient import exc from heatclient.openstack.common import jsonutils @@ -113,7 +114,10 @@ class HTTPClient(object): dump.extend(['%s: %s' % (k, v) for k, v in resp.headers.items()]) dump.append('') if resp.content: - dump.extend([resp.content.decode(), '']) + content = resp.content + if isinstance(content, six.binary_type): + content = content.decode() + dump.extend([content, '']) LOG.debug('\n'.join(dump)) def _http_request(self, url, method, **kwargs):