Saner debug log message generation

For some reason building the debug log would include spaces in the
message elements and join on the empty string. It makes much more sense
to just build the list and join on the space.

Change-Id: Idd82787b87518c56122d0b13551f84529306337c
This commit is contained in:
Jamie Lennox
2013-12-17 15:34:57 +10:00
committed by Gerrit Code Review
parent 0b25aa7c80
commit e2a5c2a829

View File

@@ -135,15 +135,15 @@ class Session(object):
string_parts = ['curl -i']
if method:
string_parts.extend([' -X ', method])
string_parts.extend(['-X', method])
string_parts.extend([' ', url])
string_parts.append(url)
if headers:
for header in six.iteritems(headers):
string_parts.append(' -H "%s: %s"' % header)
string_parts.append('-H "%s: %s"' % header)
_logger.debug('REQ: %s', ''.join(string_parts))
_logger.debug('REQ: %s', ' '.join(string_parts))
data = kwargs.get('data')
if data: