aboutsummaryrefslogtreecommitdiffstats
path: root/anteater/src/project_scan.py
diff options
context:
space:
mode:
authorlhinds <lhinds@redhat.com>2017-06-19 16:41:40 +0100
committerlhinds <lhinds@redhat.com>2017-06-19 16:41:40 +0100
commita1ffd5510f19253cf19861e7f81cdc305f371dcd (patch)
treeaf17c1906af5d661a2f3f71428b375e39e7b3e61 /anteater/src/project_scan.py
parent61155a3ccfdd6cabc78a0d0cf813a7ac0dd09f0e (diff)
Provides clarification that LICENSE is in repo
This change peforms a clarification that a LICENSE file exists within the root folder of the set project repo. This feature is only for complete project scans and not a patch scan. JIRA:RELENG-235 Change-Id: I6d238158f7501aaff6c21ecc59b505b5c79565f2 Signed-off-by: lhinds <lhinds@redhat.com>
Diffstat (limited to 'anteater/src/project_scan.py')
-rw-r--r--anteater/src/project_scan.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/anteater/src/project_scan.py b/anteater/src/project_scan.py
index 9b143e9..09a4791 100644
--- a/anteater/src/project_scan.py
+++ b/anteater/src/project_scan.py
@@ -57,6 +57,7 @@ def prepare_project(project, project_dir):
# Perform licence header checks
licence_check(licence_ext, licence_ignore, project, project_dir)
+ licence_root_check(project_dir, project)
def scan_file(project_dir, project, binary_list, binary_project_list,
@@ -124,6 +125,20 @@ def scan_file(project_dir, project, binary_list, binary_project_list,
format(full_path))
+def licence_root_check(project_dir, project):
+ if os.path.isfile(project_dir + '/LICENSE'):
+ logger.info('LICENSE file present in: {0}'.
+ format(project_dir))
+ else:
+ logger.error('LICENSE file missing in: {0}'.
+ format(project_dir))
+ with open(reports_dir + "licence-" + project + ".log",
+ "a") \
+ as gate_report:
+ gate_report.write('LICENSE file missing in: {0}\n'.
+ format(project_dir))
+
+
def licence_check(licence_ext, licence_ignore, project, project_dir):
""" Peform basic checks for the presence of licence strings """
for root, dirs, files in os.walk(project_dir):