Fix hacking check for service client
Tempest hacking check _common_service_clients_check() still has the ignored_list_T110.txt file check but this file was already deleted a long back - https://review.opendev.org/c/openstack/tempest/+/568489 This fix the pep8 check for service client checks otherwise it fail on finding the ignored_list_T110.txt file. Change-Id: I6069d1c2f6368e768640ce69981241792ea81aac
This commit is contained in:
parent
4aae013131
commit
3d9a869991
|
@ -140,20 +140,10 @@ def no_testtools_skip_decorator(logical_line):
|
||||||
"decorators.skip_because from tempest.lib")
|
"decorators.skip_because from tempest.lib")
|
||||||
|
|
||||||
|
|
||||||
def _common_service_clients_check(logical_line, physical_line, filename,
|
def _common_service_clients_check(logical_line, physical_line, filename):
|
||||||
ignored_list_file=None):
|
|
||||||
if not re.match('tempest/(lib/)?services/.*', filename):
|
if not re.match('tempest/(lib/)?services/.*', filename):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if ignored_list_file is not None:
|
|
||||||
ignored_list = []
|
|
||||||
with open('tempest/hacking/' + ignored_list_file) as f:
|
|
||||||
for line in f:
|
|
||||||
ignored_list.append(line.strip())
|
|
||||||
|
|
||||||
if filename in ignored_list:
|
|
||||||
return False
|
|
||||||
|
|
||||||
if not METHOD.match(physical_line):
|
if not METHOD.match(physical_line):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -171,7 +161,7 @@ def get_resources_on_service_clients(physical_line, logical_line, filename,
|
||||||
T110
|
T110
|
||||||
"""
|
"""
|
||||||
if not _common_service_clients_check(logical_line, physical_line,
|
if not _common_service_clients_check(logical_line, physical_line,
|
||||||
filename, 'ignored_list_T110.txt'):
|
filename):
|
||||||
return
|
return
|
||||||
|
|
||||||
for line in lines[line_number:]:
|
for line in lines[line_number:]:
|
||||||
|
@ -199,7 +189,7 @@ def delete_resources_on_service_clients(physical_line, logical_line, filename,
|
||||||
T111
|
T111
|
||||||
"""
|
"""
|
||||||
if not _common_service_clients_check(logical_line, physical_line,
|
if not _common_service_clients_check(logical_line, physical_line,
|
||||||
filename, 'ignored_list_T111.txt'):
|
filename):
|
||||||
return
|
return
|
||||||
|
|
||||||
for line in lines[line_number:]:
|
for line in lines[line_number:]:
|
||||||
|
|
Loading…
Reference in New Issue