From 261654b0590708406d6c6b19ab7eec4c2efdb4fe Mon Sep 17 00:00:00 2001 From: haobing1 Date: Thu, 1 Sep 2016 11:32:03 +0800 Subject: [PATCH] Remove self.__dict__ for formatting strings Following OpenStack Style Guidelines: http://docs.openstack.org/developer/hacking/#dictionaries-lists It is not clear as using explicit dictionaries and help avoid some errors during refactoring. Change-Id: Iac567648435cd83c3d3fafc1a3e69ea75f2b1624 --- tools/lintstack.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/lintstack.py b/tools/lintstack.py index 40f38f29c..c25936b81 100755 --- a/tools/lintstack.py +++ b/tools/lintstack.py @@ -113,7 +113,12 @@ class LintOutput(object): def review_str(self): return ("File %(filename)s\nLine %(lineno)d:%(line_content)s\n" - "%(code)s: %(message)s" % self.__dict__) # noqa:H501 + "%(code)s: %(message)s" % + {'filename': self.filename, + 'lineno': self.lineno, + 'line_content': self.line_content, + 'code': self.code, + 'message': self.message}) class ErrorKeys(object):