From 6251df9068fc60b73085b8910d7faae4502152c2 Mon Sep 17 00:00:00 2001 From: Mike Perez Date: Fri, 31 May 2013 01:11:13 -0700 Subject: [PATCH] Updating HACKING to disallow the use of locals() Change-Id: I7bf2720bdb0456274dc81a73d91296dff0e3fced --- HACKING.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/HACKING.rst b/HACKING.rst index eecb286b5..f124e0095 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -46,6 +46,15 @@ General if not (X in Y or X in Z): # OKAY, still better than all those 'not's pass +- Do not use locals(). Example:: + + LOG.debug(_("volume %(vol_name)s: creating size %(vol_size)sG") % + locals()) # BAD + + LOG.debug(_("volume %(vol_name)s: creating size %(vol_size)sG") % + {'vol_name': vol_name, + 'vol_size': vol_size}) # OKAY + Imports ------- -- 2.45.2