diff --git a/salt/ext/tornado/curl_httpclient.py b/salt/ext/tornado/curl_httpclient.py index 8652343cf7..9e4133fd13 100644 --- a/salt/ext/tornado/curl_httpclient.py +++ b/salt/ext/tornado/curl_httpclient.py @@ -494,10 +494,11 @@ def _curl_header_callback(self, headers, header_callback, header_line): def _curl_debug(self, debug_type, debug_msg): debug_types = ('I', '<', '>', '<', '>') - debug_msg = native_str(debug_msg) if debug_type == 0: + debug_msg = native_str(debug_msg) curl_log.debug('%s', debug_msg.strip()) elif debug_type in (1, 2): + debug_msg = native_str(debug_msg) for line in debug_msg.splitlines(): curl_log.debug('%s %s', debug_types[debug_type], line) elif debug_type == 4: