Update to hacking 0.12.0 and use new checks
Use hacking 0.12.0 Use the new checks that are available: [H106] Don’t put vim configuration in source files. [H203] Use assertIs(Not)None to check for None. [H904] Delay string interpolations at logging calls. Fix code so tests pass. Change-Id: I7b1cd98aeb3bb8f4f01dd1d69d1afcd839749074
This commit is contained in:
parent
cd253c3ad6
commit
ba9adaa2f5
@ -49,7 +49,7 @@ def _iptables(*args, **kwargs):
|
|||||||
LOG.debug('Ignoring failed iptables %(args)s: %(output)s',
|
LOG.debug('Ignoring failed iptables %(args)s: %(output)s',
|
||||||
{'args': args, 'output': output})
|
{'args': args, 'output': output})
|
||||||
else:
|
else:
|
||||||
LOG.error(_LE('iptables %(iptables)s failed: %(exc)s') %
|
LOG.error(_LE('iptables %(iptables)s failed: %(exc)s'),
|
||||||
{'iptables': args, 'exc': output})
|
{'iptables': args, 'exc': output})
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
@ -510,8 +510,8 @@ def find_node(**attributes):
|
|||||||
if not isinstance(value, list):
|
if not isinstance(value, list):
|
||||||
value = [value]
|
value = [value]
|
||||||
|
|
||||||
LOG.debug('Trying to use %s of value %s for node look up'
|
LOG.debug('Trying to use %s of value %s for node look up',
|
||||||
% (name, value))
|
(name, value))
|
||||||
value_list = []
|
value_list = []
|
||||||
for v in value:
|
for v in value:
|
||||||
value_list.append("name='%s' AND value='%s'" % (name, v))
|
value_list.append("name='%s' AND value='%s'" % (name, v))
|
||||||
|
@ -315,7 +315,7 @@ def _finish_set_ipmi_credentials(ironic, node, node_info, introspection_data,
|
|||||||
ironic.node.get_boot_device(node_info.uuid)
|
ironic.node.get_boot_device(node_info.uuid)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
LOG.info(_LI('Waiting for credentials update, attempt %(attempt)d '
|
LOG.info(_LI('Waiting for credentials update, attempt %(attempt)d '
|
||||||
'current error is %(exc)s') %
|
'current error is %(exc)s'),
|
||||||
{'attempt': attempt, 'exc': exc},
|
{'attempt': attempt, 'exc': exc},
|
||||||
node_info=node_info, data=introspection_data)
|
node_info=node_info, data=introspection_data)
|
||||||
eventlet.greenthread.sleep(_CREDENTIALS_WAIT_PERIOD)
|
eventlet.greenthread.sleep(_CREDENTIALS_WAIT_PERIOD)
|
||||||
@ -338,7 +338,7 @@ def _finish(ironic, node_info, introspection_data, power_off=True):
|
|||||||
if node_info.node().provision_state == 'enroll':
|
if node_info.node().provision_state == 'enroll':
|
||||||
LOG.info(_LI("Failed to power off the node in"
|
LOG.info(_LI("Failed to power off the node in"
|
||||||
"'enroll' state, ignoring; error was "
|
"'enroll' state, ignoring; error was "
|
||||||
"%s") % exc, node_info=node_info,
|
"%s"), exc, node_info=node_info,
|
||||||
data=introspection_data)
|
data=introspection_data)
|
||||||
else:
|
else:
|
||||||
msg = (_('Failed to power off node %(node)s, check '
|
msg = (_('Failed to power off node %(node)s, check '
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
coverage>=4.0 # Apache-2.0
|
coverage>=4.0 # Apache-2.0
|
||||||
doc8 # Apache-2.0
|
doc8 # Apache-2.0
|
||||||
hacking<0.12,>=0.11.0 # Apache-2.0
|
hacking<0.13,>=0.12.0 # Apache-2.0
|
||||||
mock>=2.0 # BSD
|
mock>=2.0 # BSD
|
||||||
sphinx!=1.3b1,<1.4,>=1.2.1 # BSD
|
sphinx!=1.3b1,<1.4,>=1.2.1 # BSD
|
||||||
oslosphinx>=4.7.0 # Apache-2.0
|
oslosphinx>=4.7.0 # Apache-2.0
|
||||||
|
4
tox.ini
4
tox.ini
@ -47,6 +47,10 @@ commands = oslo-config-generator --config-file config-generator.conf
|
|||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
max-complexity=15
|
max-complexity=15
|
||||||
|
# [H106] Don’t put vim configuration in source files.
|
||||||
|
# [H203] Use assertIs(Not)None to check for None.
|
||||||
|
# [H904] Delay string interpolations at logging calls.
|
||||||
|
enable-extensions=H106,H203,H904
|
||||||
|
|
||||||
[hacking]
|
[hacking]
|
||||||
import_exceptions = ironicclient.exceptions,ironic_inspector.common.i18n
|
import_exceptions = ironicclient.exceptions,ironic_inspector.common.i18n
|
||||||
|
Loading…
Reference in New Issue
Block a user