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: If22ad272c332f30624ce10861408d377908b152b Depends-On: I2aa44b62f900d4dfd67701b01eadd0523fbfaf07
This commit is contained in:
parent
fb3a56d185
commit
0b8763e332
@ -36,10 +36,10 @@ class FlowExtension(base.BaseAgentExtension, base.ExecuteCommandMixin):
|
|||||||
def start_flow(self, flow=None):
|
def start_flow(self, flow=None):
|
||||||
for task in flow:
|
for task in flow:
|
||||||
for method, params in task.items():
|
for method, params in task.items():
|
||||||
LOG.info("Executing method %s for now" % method)
|
LOG.info("Executing method %s for now", method)
|
||||||
result = self.execute_command(method, **params)
|
result = self.execute_command(method, **params)
|
||||||
result.join()
|
result.join()
|
||||||
LOG.info("%s method's execution is done" % method)
|
LOG.info("%s method's execution is done", method)
|
||||||
if result.command_status == base.AgentCommandStatus.FAILED:
|
if result.command_status == base.AgentCommandStatus.FAILED:
|
||||||
raise errors.CommandExecutionError(
|
raise errors.CommandExecutionError(
|
||||||
"%s was failed" % method
|
"%s was failed" % method
|
||||||
|
@ -48,7 +48,7 @@ def _get_partition(device, uuid):
|
|||||||
utils.execute('udevadm', 'settle')
|
utils.execute('udevadm', 'settle')
|
||||||
except processutils.ProcessExecutionError:
|
except processutils.ProcessExecutionError:
|
||||||
LOG.warning("Couldn't re-read the partition table "
|
LOG.warning("Couldn't re-read the partition table "
|
||||||
"on device %s" % device)
|
"on device %s", device)
|
||||||
|
|
||||||
report = utils.execute('lsblk', '-PbioKNAME,UUID,TYPE', device)[0]
|
report = utils.execute('lsblk', '-PbioKNAME,UUID,TYPE', device)[0]
|
||||||
for line in report.split('\n'):
|
for line in report.split('\n'):
|
||||||
|
@ -697,8 +697,8 @@ class GenericHardwareManager(HardwareManager):
|
|||||||
'agent_continue_if_ata_erase_failed', False)
|
'agent_continue_if_ata_erase_failed', False)
|
||||||
if execute_shred:
|
if execute_shred:
|
||||||
LOG.warning('Failed to invoke ata_erase, '
|
LOG.warning('Failed to invoke ata_erase, '
|
||||||
'falling back to shred: %(err)s'
|
'falling back to shred: %(err)s',
|
||||||
% {'err': e})
|
{'err': e})
|
||||||
else:
|
else:
|
||||||
msg = ('Failed to invoke ata_erase, '
|
msg = ('Failed to invoke ata_erase, '
|
||||||
'fallback to shred is not enabled: %(err)s'
|
'fallback to shred is not enabled: %(err)s'
|
||||||
|
@ -174,7 +174,7 @@ class APIClient(object):
|
|||||||
|
|
||||||
# Check for valid response data
|
# Check for valid response data
|
||||||
if 'node' not in content or 'uuid' not in content['node']:
|
if 'node' not in content or 'uuid' not in content['node']:
|
||||||
LOG.warning('Got invalid node data from the API: %s' % content)
|
LOG.warning('Got invalid node data from the API: %s', content)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if 'config' not in content:
|
if 'config' not in content:
|
||||||
@ -183,7 +183,7 @@ class APIClient(object):
|
|||||||
content['config'] = {'heartbeat_timeout':
|
content['config'] = {'heartbeat_timeout':
|
||||||
content.pop('heartbeat_timeout')}
|
content.pop('heartbeat_timeout')}
|
||||||
except KeyError:
|
except KeyError:
|
||||||
LOG.warning('Got invalid heartbeat from the API: %s' % content)
|
LOG.warning('Got invalid heartbeat from the API: %s', content)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Got valid content
|
# Got valid content
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# The order of packages is significant, because pip processes them in the order
|
# The order of packages is significant, because pip processes them in the order
|
||||||
# of appearance. Changing the order has an impact on the overall integration
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
hacking<0.12,>=0.11.0 # Apache-2.0
|
hacking<0.13,>=0.12.0 # Apache-2.0
|
||||||
coverage>=4.0 # Apache-2.0
|
coverage>=4.0 # Apache-2.0
|
||||||
mock>=2.0 # BSD
|
mock>=2.0 # BSD
|
||||||
testtools>=1.4.0 # MIT
|
testtools>=1.4.0 # MIT
|
||||||
|
4
tox.ini
4
tox.ini
@ -57,6 +57,10 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen
|
|||||||
[flake8]
|
[flake8]
|
||||||
ignore = E129
|
ignore = E129
|
||||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,imagebuild/tinyipa/tinyipafinal,imagebuild/tinyipa/tinyipabuild
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,imagebuild/tinyipa/tinyipafinal,imagebuild/tinyipa/tinyipabuild
|
||||||
|
# [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 = ironic.openstack.common.gettextutils._,testtools.matchers
|
import_exceptions = ironic.openstack.common.gettextutils._,testtools.matchers
|
||||||
|
Loading…
Reference in New Issue
Block a user