Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

866323 - do not print binary files to log #850

Merged
merged 1 commit into from
Oct 15, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cli/src/katello/client/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import kerberos
from kerberos import GSSError
import httplib
import logging
import os
import urllib
import mimetypes
Expand Down Expand Up @@ -286,8 +287,12 @@ def _process_response(self, response):
else:
pass

if response_body:
self._log.debug("processing response %s\n%s" % (response.status, u_str(response_body)))
if response_body and self._log.isEnabledFor(logging.DEBUG):
content_type = response.getheader('content-type')
if content_type and (content_type.startswith('text/') or content_type.startswith('application/json')):
self._log.debug("processing response %s\n%s" % (response.status, u_str(response_body)))
else:
self._log.debug("processing response %s of %s" % (response.status, content_type))
else:
self._log.debug("processing empty response %s" % (response.status))

Expand Down