From 377556a2210a7bd0e265fe8243ef12dbf370bf3a Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Thu, 2 Jun 2016 08:22:35 -0500 Subject: [PATCH] Undo __repr__() and __str__() parts of d5a7dcc (#33688) The repr string formatting flag is required here. Resolves #33532. --- salt/utils/jinja.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py index 25df07d3ed..1775bf1cf6 100644 --- a/salt/utils/jinja.py +++ b/salt/utils/jinja.py @@ -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) + '}'