diff --git a/ironic_inspector/firewall.py b/ironic_inspector/firewall.py index ec5cff1c2..75b689c51 100644 --- a/ironic_inspector/firewall.py +++ b/ironic_inspector/firewall.py @@ -49,7 +49,7 @@ def _iptables(*args, **kwargs): LOG.debug('Ignoring failed iptables %(args)s: %(output)s', {'args': args, 'output': output}) else: - LOG.error(_LE('iptables %(iptables)s failed: %(exc)s') % + LOG.error(_LE('iptables %(iptables)s failed: %(exc)s'), {'iptables': args, 'exc': output}) raise diff --git a/ironic_inspector/node_cache.py b/ironic_inspector/node_cache.py index a427d67b6..361afc1f4 100644 --- a/ironic_inspector/node_cache.py +++ b/ironic_inspector/node_cache.py @@ -510,8 +510,8 @@ def find_node(**attributes): if not isinstance(value, list): value = [value] - LOG.debug('Trying to use %s of value %s for node look up' - % (name, value)) + LOG.debug('Trying to use %s of value %s for node look up', + (name, value)) value_list = [] for v in value: value_list.append("name='%s' AND value='%s'" % (name, v)) diff --git a/ironic_inspector/process.py b/ironic_inspector/process.py index 5f8c7539e..926debccc 100644 --- a/ironic_inspector/process.py +++ b/ironic_inspector/process.py @@ -315,7 +315,7 @@ def _finish_set_ipmi_credentials(ironic, node, node_info, introspection_data, ironic.node.get_boot_device(node_info.uuid) except Exception as exc: LOG.info(_LI('Waiting for credentials update, attempt %(attempt)d ' - 'current error is %(exc)s') % + 'current error is %(exc)s'), {'attempt': attempt, 'exc': exc}, node_info=node_info, data=introspection_data) 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': LOG.info(_LI("Failed to power off the node in" "'enroll' state, ignoring; error was " - "%s") % exc, node_info=node_info, + "%s"), exc, node_info=node_info, data=introspection_data) else: msg = (_('Failed to power off node %(node)s, check ' diff --git a/test-requirements.txt b/test-requirements.txt index 1766e0f4b..69a1b29c2 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,7 +3,7 @@ # process, which may cause wedges in the gate later. coverage>=4.0 # 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 sphinx!=1.3b1,<1.4,>=1.2.1 # BSD oslosphinx>=4.7.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 2a63b4428..d31a4ed13 100644 --- a/tox.ini +++ b/tox.ini @@ -47,6 +47,10 @@ commands = oslo-config-generator --config-file config-generator.conf [flake8] 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] import_exceptions = ironicclient.exceptions,ironic_inspector.common.i18n