rename gatechecks and project_config 99/36299/1
authorlhinds <lhinds@redhat.com>
Wed, 21 Jun 2017 12:32:29 +0000 (13:32 +0100)
committerlhinds <lhinds@redhat.com>
Wed, 21 Jun 2017 12:32:29 +0000 (13:32 +0100)
gatechecks is renamed to master_list and project_config is
renamed to project_exceptions

JIRA:RELENG-251

Change-Id: Icbcc2c114d687783e0720017025cb4bb8e53e8a3
Signed-off-by: lhinds <lhinds@redhat.com>
anteater.conf
anteater/src/get_lists.py
anteater/src/project_scan.py
master_list.yaml [moved from gatechecks.yaml with 98% similarity]

index 8dcc897..295099f 100644 (file)
@@ -1,4 +1,4 @@
 [config]
 reports_dir =  .reports/
 anteater_log = .reports/anteater.log
-gate_checks =  ./gatechecks.yaml
+master_list =  ./master_list.yaml
index 7d6d3f1..713321f 100644 (file)
@@ -24,15 +24,17 @@ import re
 config = ConfigParser.RawConfigParser()
 config.read('anteater.conf')
 logger = antlog.Logger(__name__).getLogger()
-gate_checks = config.get('config', 'gate_checks')
+master_list = config.get('config', 'master_list')
 
-with open(gate_checks, 'r') as f:
+with open(master_list, 'r') as f:
     yl = yaml.safe_load(f)
 
+
 def _remove_nullvalue(contents):
     if contents and len(contents) > 2 and 'nullvalue' in contents:
         contents.remove('nullvalue')
 
+
 def _merge(org, ded):
     ret = copy.deepcopy(org)
     for key in list(set([k for k in org] + [k for k in ded])):
@@ -43,17 +45,18 @@ def _merge(org, ded):
             ret[key] = ded[key]
     return ret
 
+
 class GetLists(object):
     def __init__(self, *args):
         # Placeholder for future args if more filters are needed
         self.args = args
         self.loaded = False
 
-    def load_project_exception_file(self, project_config, project):
+    def load_project_exception_file(self, project_exceptions, project):
         if self.loaded:
             return
         exception_file = None
-        for item in project_config:
+        for item in project_exceptions:
             if project in item:
                 exception_file = item.get(project)
         if exception_file is not None:
@@ -67,7 +70,7 @@ class GetLists(object):
 
     def binary_list(self, project):
         project_list = False
-        self.load_project_exception_file(yl.get('project_config'), project)
+        self.load_project_exception_file(yl.get('project_exceptions'), project)
         try:
             default_list = (yl['binaries']['binary_ignore'])
         except KeyError:
@@ -91,7 +94,7 @@ class GetLists(object):
 
     def file_audit_list(self, project):
         project_list = False
-        self.load_project_exception_file(yl.get('project_config'), project)
+        self.load_project_exception_file(yl.get('project_exceptions'), project)
         try:
             default_list = set((yl['file_audits']['file_names']))
         except KeyError:
@@ -117,7 +120,7 @@ class GetLists(object):
 
     def file_content_list(self,  project):
         project_list = False
-        self.load_project_exception_file(yl.get('project_config'), project)
+        self.load_project_exception_file(yl.get('project_exceptions'), project)
         try:
             default_list = set((yl['file_audits']['file_contents']))
         except KeyError:
index 09a4791..c7c6f28 100644 (file)
@@ -27,7 +27,7 @@ logger = antlog.Logger(__name__).getLogger()
 config = ConfigParser.RawConfigParser()
 config.read('anteater.conf')
 reports_dir = config.get('config', 'reports_dir')
-gate_checks = config.get('config', 'gate_checks')
+master_list = config.get('config', 'master_list')
 ignore_dirs = ['.git']
 
 
similarity index 98%
rename from gatechecks.yaml
rename to master_list.yaml
index 3c36539..b31b770 100644 (file)
@@ -63,7 +63,7 @@ licence:
   licence_ignore:
     - '__init__.py'
 
-project_config:
+project_exceptions:
   - releng: exceptions/releng_exception.yaml
   - sandbox: exceptions/sandbox_exception.yaml
   - testproj: exceptions/sandbox_exception.yaml