Merge "Only call decode() on bytes"

This commit is contained in:
Jenkins
2014-02-19 06:30:37 +00:00
committed by Gerrit Code Review

View File

@@ -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):