Tox: reduce complexity level to 35
The max-complexity is now set at 35. We are unable to lower this due to the following offenders: ./nova/virt/xenapi/vmops.py:431:1: C901 'VMOps._spawn' is too complex (34) ./nova/network/manager.py:1226:1: C901 'NetworkManager._do_create_networks' is too complex (34) ./nova/network/neutronv2/api.py:370:1: C901 'API.allocate_for_instance' is too complex (34) Change-Id: I6101dcb594b88d346edd72eea2ef2250c4e2891f
This commit is contained in:
parent
4b1951622e
commit
6bc7e271b5
@ -1585,18 +1585,13 @@ class FakeVim(object):
|
||||
elif attr_name == "AddPortGroup":
|
||||
return lambda *args, **kwargs: self._add_port_group(attr_name,
|
||||
*args, **kwargs)
|
||||
elif attr_name == "RebootHost_Task":
|
||||
return lambda *args, **kwargs: self._just_return_task(attr_name)
|
||||
elif attr_name == "ShutdownHost_Task":
|
||||
return lambda *args, **kwargs: self._just_return_task(attr_name)
|
||||
elif attr_name == "PowerUpHostFromStandBy_Task":
|
||||
return lambda *args, **kwargs: self._just_return_task(attr_name)
|
||||
elif attr_name == "EnterMaintenanceMode_Task":
|
||||
return lambda *args, **kwargs: self._just_return_task(attr_name)
|
||||
elif attr_name == "ExitMaintenanceMode_Task":
|
||||
elif attr_name in ("RebootHost_Task",
|
||||
"ShutdownHost_Task",
|
||||
"PowerUpHostFromStandBy_Task",
|
||||
"EnterMaintenanceMode_Task",
|
||||
"ExitMaintenanceMode_Task",
|
||||
"RescanHba"):
|
||||
return lambda *args, **kwargs: self._just_return_task(attr_name)
|
||||
elif attr_name == "AddInternetScsiSendTargets":
|
||||
return lambda *args, **kwargs: self._add_iscsi_send_tgt(attr_name,
|
||||
*args, **kwargs)
|
||||
elif attr_name == "RescanHba":
|
||||
return lambda *args, **kwargs: self._just_return_task(attr_name)
|
||||
|
4
tox.ini
4
tox.ini
@ -75,9 +75,9 @@ ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405
|
||||
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools/xenserver*
|
||||
# To get a list of functions that are more complex than 25, set max-complexity
|
||||
# to 25 and run 'tox -epep8'.
|
||||
# 37 is currently the most complex thing we have
|
||||
# 34 is currently the most complex thing we have
|
||||
# TODO(jogo): get this number down to 25 or so
|
||||
max-complexity=38
|
||||
max-complexity=35
|
||||
|
||||
[hacking]
|
||||
local-check-factory = nova.hacking.checks.factory
|
||||
|
Loading…
Reference in New Issue
Block a user