Bump pycodestyle to 2.6.0

This brings in a couple of new checks, and
fixes E741 errors.

Change-Id: I04ad07cd4ea1055c0244e7444d25da6a920c530e
This commit is contained in:
Eric Harney 2020-06-09 10:10:00 -04:00 committed by Sean McGinnis
parent d95ebc4ec2
commit 0804e817de
4 changed files with 8 additions and 7 deletions

View File

@ -77,8 +77,8 @@ class HGSTConnector(base.BaseLinuxConnector):
for host in domain: for host in domain:
try: try:
ip = socket.gethostbyname(host) ip = socket.gethostbyname(host)
for l in nets: for line in nets:
x = l.strip() x = line.strip()
if x.startswith("inet %s/" % ip): if x.startswith("inet %s/" % ip):
return host return host
except socket.error: except socket.error:

View File

@ -970,9 +970,9 @@ class ISCSIConnector(base.BaseLinuxConnector, base_iscsi.BaseISCSIConnector):
lines, _err = self._execute('cat', file_path, run_as_root=True, lines, _err = self._execute('cat', file_path, run_as_root=True,
root_helper=self._root_helper) root_helper=self._root_helper)
for l in lines.split('\n'): for line in lines.split('\n'):
if l.startswith('InitiatorName='): if line.startswith('InitiatorName='):
return l[l.index('=') + 1:].strip() return line[line.index('=') + 1:].strip()
except putils.ProcessExecutionError: except putils.ProcessExecutionError:
LOG.warning("Could not find the iSCSI Initiator File %s", LOG.warning("Could not find the iSCSI Initiator File %s",
file_path) file_path)

View File

@ -88,8 +88,8 @@ class RemoteFsClient(executor.Executor):
""" """
with open("/proc/mounts", "r") as mounts: with open("/proc/mounts", "r") as mounts:
# Remove empty lines and split lines by whitespace # Remove empty lines and split lines by whitespace
lines = [l.split() for l in mounts.read().splitlines() lines = [line.split() for line in mounts.read().splitlines()
if l.strip()] if line.strip()]
# Return {mountpoint: mountdevice}. Fields 2nd and 1st as per # Return {mountpoint: mountdevice}. Fields 2nd and 1st as per
# http://man7.org/linux/man-pages/man5/fstab.5.html # http://man7.org/linux/man-pages/man5/fstab.5.html

View File

@ -11,3 +11,4 @@ testtools>=2.2.0 # MIT
stestr>=1.0.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0
oslo.vmware>=2.17.0 # Apache-2.0 oslo.vmware>=2.17.0 # Apache-2.0
castellan>=1.3.0 # Apache-2.0 castellan>=1.3.0 # Apache-2.0
pycodestyle==2.6.0 # MIT