From a0a6017f9b58941a4f8e67300a5dc57e34aada35 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Thu, 14 Aug 2014 03:40:09 -0700 Subject: [PATCH] Hacking: a new hacking check was added that used an existing number Commit 243879f5c51fc45f03491bcb78765945ddf76be8 added in a new hacking check that used an existing number. The new number is 324 (and not 323) Change-Id: I7e604a408387438105c435ad16a1fa3d6491b642 Closes-bug: #1356815 --- HACKING.rst | 1 + nova/hacking/checks.py | 2 +- nova/tests/test_hacking.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/HACKING.rst b/HACKING.rst index 7884ac1f9e8e..d4cc74b21212 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -36,6 +36,7 @@ Nova Specific Commandments - [N321] Validate that LOG messages, except debug ones, have translations - [N322] Method's default argument shouldn't be mutable - [N323] Ensure that the _() function is explicitly imported to ensure proper translations. +- [N324] Ensure that jsonutils.%(fun)s must be used instead of json.%(fun)s Creating Unit Tests ------------------- diff --git a/nova/hacking/checks.py b/nova/hacking/checks.py index a1dd61419a9b..98a309ed6c23 100644 --- a/nova/hacking/checks.py +++ b/nova/hacking/checks.py @@ -293,7 +293,7 @@ def use_jsonutils(logical_line, filename): if "plugins/xenserver" in filename: return - msg = "N323: jsonutils.%(fun)s must be used instead of json.%(fun)s" + msg = "N324: jsonutils.%(fun)s must be used instead of json.%(fun)s" if "json." in logical_line: json_funcs = ['dumps', 'dump', 'loads', 'load'] diff --git a/nova/tests/test_hacking.py b/nova/tests/test_hacking.py index f6f796b13830..522fdc91da60 100644 --- a/nova/tests/test_hacking.py +++ b/nova/tests/test_hacking.py @@ -220,7 +220,7 @@ class HackingTestCase(test.NoDBTestCase): def test_use_jsonutils(self): def __get_msg(fun): - msg = ("N323: jsonutils.%(fun)s must be used instead of " + msg = ("N324: jsonutils.%(fun)s must be used instead of " "json.%(fun)s" % {'fun': fun}) return (0, msg)