]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Corrects broken format strings in check_i18n.py
authorJay Pipes <jaypipes@gmail.com>
Tue, 24 Dec 2013 01:58:31 +0000 (20:58 -0500)
committerJay Pipes <jaypipes@gmail.com>
Tue, 24 Dec 2013 13:14:48 +0000 (08:14 -0500)
In tools/check_i18n.py, the error messages printed out
had format strings that included 5 interpolations, but only
four variables were supplied. This patch simply corrects that
mismatch by including the name of the predicate or checker
that failed.

Closes-Bug: #1263813
Change-Id: I5cacee9ea000f56a9ef45f07367e85f20fa333c7

tools/check_i18n.py

index 86207b80b4e7ecde69bcf2a0208d4cdcff282635..f9b31ebda3257ba590b899ab2d8fb1f1c18c65ad 100644 (file)
@@ -59,7 +59,8 @@ class Visitor(object):
                 if checker(node):
                     print('%s:%d %s: %s Error: %s' %
                           (self.filename, node.lineno,
-                           self.lines[node.lineno - 1][:-1], msg),
+                           self.lines[node.lineno - 1][:-1],
+                           checker.__name__, msg),
                            file=sys.stderr)
                     self.error = 1
                     return
@@ -81,7 +82,8 @@ class Visitor(object):
                     elif action == 'error':
                         print('%s:%d %s: %s Error: %s' %
                               (self.filename, node.lineno,
-                               self.lines[node.lineno - 1][:-1], msg),
+                               self.lines[node.lineno - 1][:-1],
+                               predicate.__name__, msg),
                                file=sys.stderr)
                         self.error = 1
                         return