diff --git a/os_brick/encryptors/base.py b/os_brick/encryptors/base.py index 2c90d72da..56ac444df 100644 --- a/os_brick/encryptors/base.py +++ b/os_brick/encryptors/base.py @@ -52,11 +52,13 @@ class VolumeEncryptor(executor.Executor): @abc.abstractmethod def attach_volume(self, context, **kwargs): """Hook called immediately prior to attaching a volume to an instance. + """ pass @abc.abstractmethod def detach_volume(self, **kwargs): """Hook called immediately after detaching a volume from an instance. + """ pass diff --git a/os_brick/encryptors/cryptsetup.py b/os_brick/encryptors/cryptsetup.py index 1cdaa04c0..f866b56b8 100644 --- a/os_brick/encryptors/cryptsetup.py +++ b/os_brick/encryptors/cryptsetup.py @@ -102,8 +102,7 @@ class CryptsetupEncryptor(base.VolumeEncryptor): return binascii.hexlify(key).decode('utf-8') def _open_volume(self, passphrase, **kwargs): - """Opens the LUKS partition on the volume using the specified - passphrase. + """Open the LUKS partition on the volume using passphrase. :param passphrase: the passphrase used to access the volume """ @@ -129,6 +128,7 @@ class CryptsetupEncryptor(base.VolumeEncryptor): def _get_mangled_passphrase(self, key): """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 # 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) def attach_volume(self, context, **kwargs): - """Shadows the device and passes an unencrypted version to the - instance. + """Shadow the device and pass an unencrypted version to the instance. Transparent disk encryption is achieved by mounting the volume via dm-crypt and passing the resulting device to the instance. The diff --git a/os_brick/encryptors/luks.py b/os_brick/encryptors/luks.py index 93cf9f92e..3e0f1bb56 100644 --- a/os_brick/encryptors/luks.py +++ b/os_brick/encryptors/luks.py @@ -87,8 +87,7 @@ class LuksEncryptor(cryptsetup.CryptsetupEncryptor): attempts=3) def _open_volume(self, passphrase, **kwargs): - """Opens the LUKS partition on the volume using the specified - passphrase. + """Opens the LUKS partition on the volume using passphrase. :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) def attach_volume(self, context, **kwargs): - """Shadows the device and passes an unencrypted version to the - instance. + """Shadow the device and pass an unencrypted version to the instance. Transparent disk encryption is achieved by mounting the volume via dm-crypt and passing the resulting device to the instance. The diff --git a/os_brick/initiator/linuxscsi.py b/os_brick/initiator/linuxscsi.py index e5898aae6..9387d924e 100644 --- a/os_brick/initiator/linuxscsi.py +++ b/os_brick/initiator/linuxscsi.py @@ -126,7 +126,9 @@ class LinuxSCSI(executor.Executor): return True 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. """ diff --git a/os_brick/initiator/windows/iscsi.py b/os_brick/initiator/windows/iscsi.py index 14e8099d4..26a341dd2 100644 --- a/os_brick/initiator/windows/iscsi.py +++ b/os_brick/initiator/windows/iscsi.py @@ -38,7 +38,9 @@ class WindowsISCSIConnector(win_conn_base.BaseWindowsConnector, self.validate_initiators() 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. """ valid_initiator_list = True diff --git a/os_brick/remotefs/remotefs.py b/os_brick/remotefs/remotefs.py index 71a5a7f5c..0f685624f 100644 --- a/os_brick/remotefs/remotefs.py +++ b/os_brick/remotefs/remotefs.py @@ -66,10 +66,7 @@ class RemoteFsClient(executor.Executor): return self._mount_base def _get_hash_str(self, base_str): - """Return a string that represents hash of base_str - (in a hex format). - - """ + """Return a string that represents hash of base_str (hex format).""" if isinstance(base_str, six.text_type): base_str = base_str.encode('utf-8') return hashlib.md5(base_str).hexdigest() diff --git a/tools/lintstack.py b/tools/lintstack.py index c25936b81..dae9cf5fb 100755 --- a/tools/lintstack.py +++ b/tools/lintstack.py @@ -79,7 +79,9 @@ class LintOutput(object): @classmethod 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 """ result = {} diff --git a/tox.ini b/tox.ini index e42a92eea..550959941 100644 --- a/tox.ini +++ b/tox.ini @@ -78,7 +78,7 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen show-source = True -ignore = E251,H405,H904 +ignore = E251,H904 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build max-complexity=30