summaryrefslogtreecommitdiffstats
path: root/custodia/httpd/server.py
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2015-11-06 13:04:58 +0100
committerSimo Sorce <simo@redhat.com>2015-11-11 11:37:15 -0500
commit38fa5ecd780a6b00b70a450c4716320865ef4227 (patch)
tree3b752a06d8b7b9f277c30383df9b99836d8bc53e /custodia/httpd/server.py
parentd3c907cb21416a23e8f736f156ea807f6d1d00c5 (diff)
downloadcustodia-38fa5ecd780a6b00b70a450c4716320865ef4227.tar.gz
custodia-38fa5ecd780a6b00b70a450c4716320865ef4227.tar.xz
custodia-38fa5ecd780a6b00b70a450c4716320865ef4227.zip
Increase logging output of Kubernetes pluginskube
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Diffstat (limited to 'custodia/httpd/server.py')
-rw-r--r--custodia/httpd/server.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/custodia/httpd/server.py b/custodia/httpd/server.py
index decf401..392d8fb 100644
--- a/custodia/httpd/server.py
+++ b/custodia/httpd/server.py
@@ -159,7 +159,7 @@ class HTTPRequestHandler(BaseHTTPRequestHandler):
try:
creds = self.request.getsockopt(socket.SOL_SOCKET, SO_PEERSEC,
SELINUX_CONTEXT_LEN)
- context = creds.decode('utf-8')
+ context = creds.rstrip(b'\x00').decode('utf-8')
except Exception: # pylint: disable=broad-except
logger.debug("Couldn't retrieve SELinux Context", exc_info=True)
context = None
@@ -245,7 +245,13 @@ class HTTPRequestHandler(BaseHTTPRequestHandler):
'version': self.request_version,
'headers': self.headers,
'body': self.body}
- logger.debug("REQUEST: %r", request)
+ logger.debug(
+ "REQUEST: %s %s, query: %r, cred: %r, client_id: %s, "
+ "headers: %r, body: %r",
+ request['command'], request['path'], request['query'],
+ request['creds'], request['client_id'],
+ dict(request['headers']), request['body']
+ )
try:
response = self.pipeline(self.server.config, request)
if response is None: