Undo __repr__() and __str__() parts of d5a7dcc (#33688)

The repr string formatting flag is required here.

Resolves #33532.
This commit is contained in:
Erik Johnson 2016-06-02 08:22:35 -05:00 committed by Nicole Thomas
parent 778b290d94
commit 377556a221

View File

@ -72,7 +72,7 @@ class SaltCacheLoader(BaseLoader):
self.searchpath = opts['file_roots'][saltenv]
else:
self.searchpath = [path.join(opts['cachedir'], 'files', saltenv)]
log.debug('Jinja search path: \'{0}\''.format(self.searchpath))
log.debug('Jinja search path: %s', self.searchpath)
self._file_client = None
self.cached = []
self.pillar_rend = pillar_rend
@ -163,10 +163,10 @@ class PrintableDict(OrderedDict):
for key, value in six.iteritems(self):
if isinstance(value, six.string_types):
# keeps quotes around strings
output.append('\'{0}\': \'{1}\''.format(key, value))
output.append('{0!r}: {1!r}'.format(key, value))
else:
# let default output
output.append('\'{0}\': {1!s}'.format(key, value))
output.append('{0!r}: {1!s}'.format(key, value))
return '{' + ', '.join(output) + '}'
def __repr__(self): # pylint: disable=W0221
@ -174,7 +174,7 @@ class PrintableDict(OrderedDict):
for key, value in six.iteritems(self):
# Raw string formatter required here because this is a repr
# function.
output.append('\'{0}\': {1!r}'.format(key, value))
output.append('{0!r}: {1!r}'.format(key, value))
return '{' + ', '.join(output) + '}'