Merge "Only call decode() on bytes"
This commit is contained in:
@@ -19,6 +19,7 @@ import os
|
|||||||
import socket
|
import socket
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
import six
|
||||||
|
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
from heatclient.openstack.common import jsonutils
|
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.extend(['%s: %s' % (k, v) for k, v in resp.headers.items()])
|
||||||
dump.append('')
|
dump.append('')
|
||||||
if resp.content:
|
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))
|
LOG.debug('\n'.join(dump))
|
||||||
|
|
||||||
def _http_request(self, url, method, **kwargs):
|
def _http_request(self, url, method, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user