Stop ignoring H405 hacking rule in tox

This change is one in the series of changes to
align os-brick with Cinder rules.

- H405 'multi line docstring summary not
        separated with an empty line'

See following for more information:
 https://github.com/openstack-dev/hacking

Change-Id: Id67324c0ef22287d91b49ae11eda094bf73739a1
Signed-off-by: Maciej Kucia <maciej@kucia.net>
This commit is contained in:
Maciej Kucia 2017-05-21 23:05:53 +02:00
parent 211bda0a04
commit d9ac24d0d2
8 changed files with 18 additions and 16 deletions

View File

@ -52,11 +52,13 @@ class VolumeEncryptor(executor.Executor):
@abc.abstractmethod @abc.abstractmethod
def attach_volume(self, context, **kwargs): def attach_volume(self, context, **kwargs):
"""Hook called immediately prior to attaching a volume to an instance. """Hook called immediately prior to attaching a volume to an instance.
""" """
pass pass
@abc.abstractmethod @abc.abstractmethod
def detach_volume(self, **kwargs): def detach_volume(self, **kwargs):
"""Hook called immediately after detaching a volume from an instance. """Hook called immediately after detaching a volume from an instance.
""" """
pass pass

View File

@ -102,8 +102,7 @@ class CryptsetupEncryptor(base.VolumeEncryptor):
return binascii.hexlify(key).decode('utf-8') return binascii.hexlify(key).decode('utf-8')
def _open_volume(self, passphrase, **kwargs): def _open_volume(self, passphrase, **kwargs):
"""Opens the LUKS partition on the volume using the specified """Open the LUKS partition on the volume using passphrase.
passphrase.
:param passphrase: the passphrase used to access the volume :param passphrase: the passphrase used to access the volume
""" """
@ -129,6 +128,7 @@ class CryptsetupEncryptor(base.VolumeEncryptor):
def _get_mangled_passphrase(self, key): def _get_mangled_passphrase(self, key):
"""Convert the raw key into a list of unsigned int's and then a string """Convert the raw key into a list of unsigned int's and then a string
""" """
# NOTE(lyarwood): This replicates the methods used prior to Newton to # NOTE(lyarwood): This replicates the methods used prior to Newton to
# first encode the passphrase as a list of unsigned int's before # first encode the passphrase as a list of unsigned int's before
@ -139,8 +139,7 @@ class CryptsetupEncryptor(base.VolumeEncryptor):
return ''.join(hex(x).replace('0x', '') for x in encoded_key) return ''.join(hex(x).replace('0x', '') for x in encoded_key)
def attach_volume(self, context, **kwargs): def attach_volume(self, context, **kwargs):
"""Shadows the device and passes an unencrypted version to the """Shadow the device and pass an unencrypted version to the instance.
instance.
Transparent disk encryption is achieved by mounting the volume via Transparent disk encryption is achieved by mounting the volume via
dm-crypt and passing the resulting device to the instance. The dm-crypt and passing the resulting device to the instance. The

View File

@ -87,8 +87,7 @@ class LuksEncryptor(cryptsetup.CryptsetupEncryptor):
attempts=3) attempts=3)
def _open_volume(self, passphrase, **kwargs): def _open_volume(self, passphrase, **kwargs):
"""Opens the LUKS partition on the volume using the specified """Opens the LUKS partition on the volume using passphrase.
passphrase.
:param passphrase: the passphrase used to access the volume :param passphrase: the passphrase used to access the volume
""" """
@ -137,8 +136,7 @@ class LuksEncryptor(cryptsetup.CryptsetupEncryptor):
LOG.debug("%s mangled passphrase successfully replaced", self.dev_path) LOG.debug("%s mangled passphrase successfully replaced", self.dev_path)
def attach_volume(self, context, **kwargs): def attach_volume(self, context, **kwargs):
"""Shadows the device and passes an unencrypted version to the """Shadow the device and pass an unencrypted version to the instance.
instance.
Transparent disk encryption is achieved by mounting the volume via Transparent disk encryption is achieved by mounting the volume via
dm-crypt and passing the resulting device to the instance. The dm-crypt and passing the resulting device to the instance. The

View File

@ -126,7 +126,9 @@ class LinuxSCSI(executor.Executor):
return True return True
def remove_multipath_device(self, device): def remove_multipath_device(self, device):
"""This removes LUNs associated with a multipath device """Removes related LUNs and multipath device
This removes LUNs associated with a multipath device
and the multipath device itself. and the multipath device itself.
""" """

View File

@ -38,7 +38,9 @@ class WindowsISCSIConnector(win_conn_base.BaseWindowsConnector,
self.validate_initiators() self.validate_initiators()
def validate_initiators(self): def validate_initiators(self):
"""Validates the list of requested initiator HBAs to be used """Validates the list of requested initiator HBAs
Validates the list of requested initiator HBAs to be used
when establishing iSCSI sessions. when establishing iSCSI sessions.
""" """
valid_initiator_list = True valid_initiator_list = True

View File

@ -66,10 +66,7 @@ class RemoteFsClient(executor.Executor):
return self._mount_base return self._mount_base
def _get_hash_str(self, base_str): def _get_hash_str(self, base_str):
"""Return a string that represents hash of base_str """Return a string that represents hash of base_str (hex format)."""
(in a hex format).
"""
if isinstance(base_str, six.text_type): if isinstance(base_str, six.text_type):
base_str = base_str.encode('utf-8') base_str = base_str.encode('utf-8')
return hashlib.md5(base_str).hexdigest() return hashlib.md5(base_str).hexdigest()

View File

@ -79,7 +79,9 @@ class LintOutput(object):
@classmethod @classmethod
def from_msg_to_dict(cls, msg): def from_msg_to_dict(cls, msg):
"""From the output of pylint msg, to a dict, where each key """Converts pytlint message to a unique-error dictionary.
From the output of pylint msg, to a dict, where each key
is a unique error identifier, value is a list of LintOutput is a unique error identifier, value is a list of LintOutput
""" """
result = {} result = {}

View File

@ -78,7 +78,7 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen
show-source = True show-source = True
ignore = E251,H405,H904 ignore = E251,H904
builtins = _ builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
max-complexity=30 max-complexity=30