From: Eric Harney Date: Mon, 16 Dec 2013 22:29:32 +0000 (-0500) Subject: Pylint fixes for Brick iSCSI/LVM X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4545f1b99e7202f50666bd74d94aa99a8adaa615;p=openstack-build%2Fcinder-build.git Pylint fixes for Brick iSCSI/LVM Fixes a few of the more straightforward pylint errors in these files. (anomalous-backslash-in-string, attribute-defined-outside-init, and bad-indentation) Change-Id: Ic131717a83fe182fe578b63eccf364d300a8989c --- diff --git a/cinder/brick/iscsi/iscsi.py b/cinder/brick/iscsi/iscsi.py index d6cb0ff92..d942e9886 100644 --- a/cinder/brick/iscsi/iscsi.py +++ b/cinder/brick/iscsi/iscsi.py @@ -427,6 +427,7 @@ class FakeIscsiHelper(object): def __init__(self): self.tid = 1 + self._execute = None def set_execute(self, execute): self._execute = execute @@ -495,11 +496,11 @@ class LioAdm(TargetAdmin): command_args.extend(extra_args) self._execute(*command_args, run_as_root=True) except putils.ProcessExecutionError as e: - LOG.error(_("Failed to create iscsi target for volume " - "id:%s.") % vol_id) - LOG.error("%s" % str(e)) + LOG.error(_("Failed to create iscsi target for volume " + "id:%s.") % vol_id) + LOG.error("%s" % str(e)) - raise exception.ISCSITargetCreateFailed(volume_id=vol_id) + raise exception.ISCSITargetCreateFailed(volume_id=vol_id) iqn = '%s%s' % (self.iscsi_target_prefix, vol_id) tid = self._get_target(iqn) diff --git a/cinder/brick/local_dev/lvm.py b/cinder/brick/local_dev/lvm.py index b8a952623..11d89e07d 100644 --- a/cinder/brick/local_dev/lvm.py +++ b/cinder/brick/local_dev/lvm.py @@ -178,7 +178,7 @@ class LVM(executor.Executor): # NOTE(gfidente): version is formatted as follows: # major.minor.patchlevel(library API version)[-customisation] version = version_list[2] - version_filter = "(\d+)\.(\d+)\.(\d+).*" + version_filter = r"(\d+)\.(\d+)\.(\d+).*" r = re.search(version_filter, version) version_tuple = tuple(map(int, r.group(1, 2, 3))) return version_tuple