X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=anteater%2Fsrc%2Fpatch_scan.py;fp=anteater%2Fsrc%2Fpatch_scan.py;h=133b0ff6a26bc312be08ca20c511cb2c78192334;hb=1d191aa05617587f889880bb5344c84a422706e5;hp=3b71f0a4c549056f82fd2fea623a2caebbf98269;hpb=3cae5dfd7bbcb64f1ac6fb2263043b251a15ebc0;p=releng-anteater.git diff --git a/anteater/src/patch_scan.py b/anteater/src/patch_scan.py index 3b71f0a..133b0ff 100644 --- a/anteater/src/patch_scan.py +++ b/anteater/src/patch_scan.py @@ -47,7 +47,7 @@ def prepare_patchset(project, patchset): file_audit_list, file_audit_project_list = lists.file_audit_list(project) # Get file content black list and project waivers - master_list, project_list_re = lists.file_content_list(project) + master_list, ignore_list = lists.file_content_list(project) # Get File Ignore Lists file_ignore = lists.file_ignore() @@ -69,7 +69,7 @@ def prepare_patchset(project, patchset): # Perform binary and file / content checks scan_patch(project, patch_file, binary_list, file_audit_list, file_audit_project_list, - master_list, project_list_re, licence_ext, + master_list, ignore_list, licence_ext, file_ignore, licence_ignore) # Process each file in patch set using waivers generated above @@ -79,7 +79,7 @@ def prepare_patchset(project, patchset): def scan_patch(project, patch_file, binary_list, file_audit_list, file_audit_project_list, master_list, - project_list_re, licence_ext, file_ignore, licence_ignore): + ignore_list, licence_ext, file_ignore, licence_ignore): """ Scan actions for each commited file in patch set """ global failure if is_binary(patch_file): @@ -130,7 +130,8 @@ def scan_patch(project, patch_file, binary_list, file_audit_list, for key, value in master_list.iteritems(): regex = value['regex'] desc = value['desc'] - if re.search(regex, line) and not re.search(project_list_re, line): + if re.search(regex, line) and not re.search( + ignore_list, line): logger.error('File contains violation: %s', patch_file) logger.error('Flagged Content: %s', line.rstrip()) logger.error('Matched Regular Exp: %s', regex)