Remove string concatenation in favor of string formatting

Some of the modules still utilized string concatenation
instead of using formatting.  In order to align with other
modules in the project, I refactored these modules to use string
formatting instead.

Change-Id: I708392e1d03b6331a134419aa0ae9dc02a05c31b
Closes-Bug: 1522738
This commit is contained in:
Steve Wilkerson
2015-12-09 08:38:52 -06:00
committed by Jean-Emile DARTOIS
parent 62570525ad
commit 1c49d07912
8 changed files with 20 additions and 31 deletions

View File

@@ -74,13 +74,13 @@ class ParsableErrorMiddleware(object):
try:
# simple check xml is valid
body = [et.ElementTree.tostring(
et.ElementTree.fromstring('<error_message>'
+ '\n'.join(app_iter)
+ '</error_message>'))]
et.ElementTree.Element('error_message',
text='\n'.join(app_iter)))]
except et.ElementTree.ParseError as err:
LOG.error(_LE('Error parsing HTTP response: %s'), err)
body = ['<error_message>%s' % state['status_code']
+ '</error_message>']
body = [et.ElementTree.tostring(
et.ElementTree.Element('error_message',
text=state['status_code']))]
state['headers'].append(('Content-Type', 'application/xml'))
else:
if six.PY3: