hacking: Stop special casing 'plugins.xenserver'

This module was removed in I1b64ea1f5906b0c4dd1d5e311095cfe41e884ff7 and
no longer needs to be worried about.

Change-Id: I6cb74210934f71bb77ad775ea6671b4e2792f8c0
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2020-08-31 15:48:54 +01:00
parent d4e6e9151c
commit 31b2fd114c
2 changed files with 14 additions and 17 deletions

View File

@ -362,12 +362,6 @@ def check_explicit_underscore_import(logical_line, filename):
@core.flake8ext
def use_jsonutils(logical_line, filename):
# the code below that path is not meant to be executed from neutron
# tree where jsonutils module is present, so don't enforce its usage
# for this subdirectory
if "plugins/xenserver" in filename:
return
# tools are OK to use the standard json module
if "/tools/" in filename:
return

View File

@ -246,17 +246,20 @@ class HackingTestCase(test.NoDBTestCase):
for method in ('dump', 'dumps', 'load', 'loads'):
self.assertEqual(
__get_msg(method),
list(checks.use_jsonutils("json.%s(" % method,
"./nova/virt/xenapi/driver.py")))
self.assertEqual(0,
len(list(checks.use_jsonutils("json.%s(" % method,
"./plugins/xenserver/script.py"))))
self.assertEqual(0,
len(list(checks.use_jsonutils("jsonx.%s(" % method,
"./nova/virt/xenapi/driver.py"))))
self.assertEqual(0,
len(list(checks.use_jsonutils("json.dumb",
"./nova/virt/xenapi/driver.py"))))
list(checks.use_jsonutils(
"json.%s(" % method, "./nova/virt/libvirt/driver.py")),
)
self.assertEqual(
0,
len(list(checks.use_jsonutils(
"jsonx.%s(" % method, "./nova/virt/libvirt/driver.py"))),
)
self.assertEqual(
0,
len(list(checks.use_jsonutils(
"json.dumb", "./nova/virt/libvirt/driver.py"))),
)
# We are patching pycodestyle so that only the check under test is actually
# installed.