aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--anteater.conf2
-rw-r--r--anteater/src/get_lists.py17
-rw-r--r--anteater/src/project_scan.py2
-rw-r--r--exceptions/functest.yaml (renamed from exceptions/sandbox_exception.yaml)0
-rw-r--r--exceptions/octopus.yaml13
-rw-r--r--exceptions/pharos.yaml12
-rw-r--r--exceptions/releng.yaml (renamed from exceptions/releng_exception.yaml)0
-rw-r--r--exceptions/sandbox.yaml13
-rw-r--r--master_list.yaml (renamed from gatechecks.yaml)10
9 files changed, 56 insertions, 13 deletions
diff --git a/anteater.conf b/anteater.conf
index 8dcc897..295099f 100644
--- a/anteater.conf
+++ b/anteater.conf
@@ -1,4 +1,4 @@
[config]
reports_dir = .reports/
anteater_log = .reports/anteater.log
-gate_checks = ./gatechecks.yaml
+master_list = ./master_list.yaml
diff --git a/anteater/src/get_lists.py b/anteater/src/get_lists.py
index 7d6d3f1..713321f 100644
--- a/anteater/src/get_lists.py
+++ b/anteater/src/get_lists.py
@@ -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:
diff --git a/anteater/src/project_scan.py b/anteater/src/project_scan.py
index 09a4791..c7c6f28 100644
--- a/anteater/src/project_scan.py
+++ b/anteater/src/project_scan.py
@@ -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']
diff --git a/exceptions/sandbox_exception.yaml b/exceptions/functest.yaml
index e41b04a..e41b04a 100644
--- a/exceptions/sandbox_exception.yaml
+++ b/exceptions/functest.yaml
diff --git a/exceptions/octopus.yaml b/exceptions/octopus.yaml
new file mode 100644
index 0000000..e41b04a
--- /dev/null
+++ b/exceptions/octopus.yaml
@@ -0,0 +1,13 @@
+# When adding projects all `arrays: []` sections must have
+# a value, Use 'nullvalue' if no waivers are available.
+#
+# This file uses standard regular expression syntax, however be mindful
+# of escaping YAML delimiters too (such as `:`) using double quotes "".
+
+binaries:
+ binary_ignore: [nullvalue]
+file_audits:
+ file_names: [nullvalue]
+ file_contents:
+ - ^#
+
diff --git a/exceptions/pharos.yaml b/exceptions/pharos.yaml
new file mode 100644
index 0000000..94dee8e
--- /dev/null
+++ b/exceptions/pharos.yaml
@@ -0,0 +1,12 @@
+# When adding projects all `arrays: []` sections must have
+# a value, Use 'nullvalue' if no waivers are available.
+#
+# This file uses standard regular expression syntax, however be mindful
+# of escaping YAML delimiters too (such as `:`) using double quotes "".
+
+binaries:
+ binary_ignore: [nullvalue]
+file_audits:
+ file_names: [nullvalue]
+ file_contents:
+ - ^#
diff --git a/exceptions/releng_exception.yaml b/exceptions/releng.yaml
index aee6768..aee6768 100644
--- a/exceptions/releng_exception.yaml
+++ b/exceptions/releng.yaml
diff --git a/exceptions/sandbox.yaml b/exceptions/sandbox.yaml
new file mode 100644
index 0000000..e41b04a
--- /dev/null
+++ b/exceptions/sandbox.yaml
@@ -0,0 +1,13 @@
+# When adding projects all `arrays: []` sections must have
+# a value, Use 'nullvalue' if no waivers are available.
+#
+# This file uses standard regular expression syntax, however be mindful
+# of escaping YAML delimiters too (such as `:`) using double quotes "".
+
+binaries:
+ binary_ignore: [nullvalue]
+file_audits:
+ file_names: [nullvalue]
+ file_contents:
+ - ^#
+
diff --git a/gatechecks.yaml b/master_list.yaml
index 3c36539..309876c 100644
--- a/gatechecks.yaml
+++ b/master_list.yaml
@@ -63,7 +63,9 @@ licence:
licence_ignore:
- '__init__.py'
-project_config:
- - releng: exceptions/releng_exception.yaml
- - sandbox: exceptions/sandbox_exception.yaml
- - testproj: exceptions/sandbox_exception.yaml
+project_exceptions:
+ - releng: exceptions/releng.yaml
+ - sandbox: exceptions/sandbox.yaml
+ - pharos: exceptions/pharos.yaml
+ - octopus: exceptions/octopus.yaml
+ - functest: exceptions/functest.yaml