Merge "Hacking: a new hacking check was added that used an existing number"

This commit is contained in:
Jenkins
2014-08-14 20:45:17 +00:00
committed by Gerrit Code Review
3 changed files with 3 additions and 2 deletions

View File

@@ -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
-------------------

View File

@@ -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(']

View File

@@ -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)]