Enable Comparison to None should use 'is' Error

Flake8 currently ignores comparison to None should be 'if cond is None'
Enable E711 for more thorough testing of code

Change-Id: I608cceff2eeb87c116bccddac26e3c869e5d57df
Story: 2004515
Task: 30076
Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
This commit is contained in:
Eric Barrett
2019-03-21 10:00:18 -04:00
parent 01cfb103bc
commit 360ad25564
3 changed files with 4 additions and 5 deletions

View File

@@ -1429,7 +1429,7 @@ if __name__ == "__main__":
SERVICES_INFO = tuple(config.get("ApiStatsServices", "API_STATS_STRUCTURE").split('|'))
for service_string in SERVICES_INFO:
service_tuple = tuple(service_string.split(';'))
if service_tuple[2] != "" and service_tuple[2] != None:
if service_tuple[2] != "" and service_tuple[2] is not None:
SERVICES[service_tuple[0]] = {'name': service_tuple[1], 'api-port': service_tuple[2]}
else:
SERVICES[service_tuple[0]] = {'name': service_tuple[1], 'api-port': None}

View File

@@ -1510,7 +1510,7 @@ def get_info_and_display(show=None):
q = select([S.name,
S.region_name,
S.deleted_at]
).where(S.deleted_at == None)
).where(S.deleted_at is None)
result = conn.execute(q)
for row in result:
field = 'region_name'
@@ -1527,7 +1527,7 @@ def get_info_and_display(show=None):
q = select([S.name,
S.region_name,
S.deleted_at]
).where(S.deleted_at == None)
).where(S.deleted_at is None)
result = conn.execute(q)
for row in result:
name = str(row['name'])