Browse Source

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>
changes/01/749301/1
Stephen Finucane 11 months ago
parent
commit
31b2fd114c
  1. 6
      nova/hacking/checks.py
  2. 25
      nova/tests/unit/test_hacking.py

6
nova/hacking/checks.py

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

25
nova/tests/unit/test_hacking.py

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

Loading…
Cancel
Save