Merge "Make process_header private"

This commit is contained in:
Jenkins
2015-04-17 15:01:16 +00:00
committed by Gerrit Code Review

View File

@@ -148,8 +148,8 @@ class Session(object):
if user_agent is not None: if user_agent is not None:
self.user_agent = user_agent self.user_agent = user_agent
@classmethod @staticmethod
def process_header(cls, header): def _process_header(header):
"""Redacts the secure headers to be logged.""" """Redacts the secure headers to be logged."""
secure_headers = ('authorization', 'x-auth-token', secure_headers = ('authorization', 'x-auth-token',
'x-subject-token',) 'x-subject-token',)
@@ -186,7 +186,7 @@ class Session(object):
if headers: if headers:
for header in six.iteritems(headers): for header in six.iteritems(headers):
string_parts.append('-H "%s: %s"' string_parts.append('-H "%s: %s"'
% Session.process_header(header)) % self._process_header(header))
if json: if json:
data = jsonutils.dumps(json) data = jsonutils.dumps(json)
if data: if data:
@@ -217,7 +217,7 @@ class Session(object):
string_parts.append('[%s]' % status_code) string_parts.append('[%s]' % status_code)
if headers: if headers:
for header in six.iteritems(headers): for header in six.iteritems(headers):
string_parts.append('%s: %s' % Session.process_header(header)) string_parts.append('%s: %s' % self._process_header(header))
if text: if text:
string_parts.append('\nRESP BODY: %s\n' % text) string_parts.append('\nRESP BODY: %s\n' % text)