Enable Flake8 Whitespace Errors

Flake8 currently ignores a number of whitespace related errors:
E201: whitespace after '['
E202: whitespace before '}'
E203: whitespace before ':'
E211: whitespace before '('
E221: multiple spaces before operator
E222: multiple spaces after operator
E225: missing whitespace around operator
E226: missing whitespace around arithmetic operator
E231: missing whitespace after ','
E251: unexpected spaces around keyword / parameter equals
E261: at least two spaces before inline comment
Enable them for more thorough testing of code

Change-Id: Id03f36070b8f16694a12f4d36858680b6e00d530
Story: 2004515
Task: 30076
Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
This commit is contained in:
Eric Barrett
2019-03-26 15:02:53 -04:00
parent a16b3f8a19
commit 2344de88df
4 changed files with 7 additions and 7 deletions

View File

@@ -217,7 +217,7 @@ def read_func():
else: else:
_delta = (c.cpu_time[_cpu_count] - c.cpu_time_last[_cpu_count]) _delta = (c.cpu_time[_cpu_count] - c.cpu_time_last[_cpu_count])
_delta = _delta / 1000000 / _time_delta _delta = _delta / 1000000 / _time_delta
cpu_occupancy.append(float((100*(_delta))/1000)) cpu_occupancy.append(float((100 * (_delta)) / 1000))
c.total_avg_cpu += cpu_occupancy[_cpu_count] c.total_avg_cpu += cpu_occupancy[_cpu_count]
if debug: if debug:
collectd.info('%s cpu %d - count:%d [%s]' % collectd.info('%s cpu %d - count:%d [%s]' %

View File

@@ -416,7 +416,7 @@ def get_timestamp(lmon_time):
if lmon_time: if lmon_time:
try: try:
return(float(float(lmon_time)/1000000)) return(float(float(lmon_time) / 1000000))
except: except:
collectd.error("%s failed to parse timestamp ;" collectd.error("%s failed to parse timestamp ;"
" using current time" % PLUGIN) " using current time" % PLUGIN)

View File

@@ -268,7 +268,7 @@ def read_func():
UPPER_HEX_IP += val UPPER_HEX_IP += val
UPPER_HEX_IP += ':' UPPER_HEX_IP += ':'
tmp = hex(int(port)).split('x')[-1].upper() tmp = hex(int(port)).split('x')[-1].upper()
for i in range(4-len(tmp)): for i in range(4 - len(tmp)):
UPPER_HEX_IP += '0' UPPER_HEX_IP += '0'
UPPER_HEX_IP += tmp UPPER_HEX_IP += tmp

View File

@@ -91,7 +91,7 @@ show = {}
# Constants # Constants
Ki = 1024 Ki = 1024
Mi = Ki*Ki Mi = Ki * Ki
# Active worker pids # Active worker pids
active_pids = multiprocessing.Manager().dict() active_pids = multiprocessing.Manager().dict()
@@ -605,8 +605,8 @@ def do_libvirt_domain_info(tuple_hosts):
with suppress_stdout_stderr(): with suppress_stdout_stderr():
d_vcpus = dom.vcpus() d_vcpus = dom.vcpus()
except Exception as e: except Exception as e:
d_vcpus = tuple([d_nrVirtCpu*[], d_vcpus = tuple([d_nrVirtCpu * [],
d_nrVirtCpu*[tuple(total_cpus * [False])]]) d_nrVirtCpu * [tuple(total_cpus * [False])]])
# Obtain cpulist of pcpus in the order of vcpus. This applies to either # Obtain cpulist of pcpus in the order of vcpus. This applies to either
# pinned or floating vcpus, Note that the cpuinfo pcpu value can be # pinned or floating vcpus, Note that the cpuinfo pcpu value can be
@@ -1379,7 +1379,7 @@ def print_all_tables(tenants=None,
I.name, I.name,
I.min_disk, I.min_disk,
I.min_ram, I.min_ram,
'%.2f' % (I.size/1024.0/1024.0), '%.2f' % (I.size / 1024.0 / 1024.0),
I.status, I.status,
I.properties, I.properties,
]) ])