Merge "Hacking: a new hacking check was added that used an existing number"
This commit is contained in:
@@ -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
|
||||
-------------------
|
||||
|
||||
@@ -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(']
|
||||
|
||||
@@ -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)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user