aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation/specification_parser.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2021-05-03 14:22:31 +0200
committerTibor Frank <tifrank@cisco.com>2021-06-08 08:18:58 +0200
commitc763cfcb064e4f4acf6b8309b08d3800b9bd5331 (patch)
treee47b01ffb250c7eafdad140f336d492e358f851c /resources/tools/presentation/specification_parser.py
parentfd84de690150a1ef15eeeebc32f70ff54cb25e66 (diff)
PAL: Convert XML to JSON
Change-Id: I24f0ddc412d4353ba244c58a3068b5b0ea4349e3 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/specification_parser.py')
-rw-r--r--resources/tools/presentation/specification_parser.py32
1 files changed, 25 insertions, 7 deletions
diff --git a/resources/tools/presentation/specification_parser.py b/resources/tools/presentation/specification_parser.py
index 4110bfff9b..a94d09f3fa 100644
--- a/resources/tools/presentation/specification_parser.py
+++ b/resources/tools/presentation/specification_parser.py
@@ -192,7 +192,7 @@ class Specification:
:returns: List of specifications of tables to be generated.
:rtype: list
"""
- return self._specification[u"tables"]
+ return self._specification.get(u"tables", list())
@property
def plots(self):
@@ -201,7 +201,7 @@ class Specification:
:returns: List of specifications of plots to be generated.
:rtype: list
"""
- return self._specification[u"plots"]
+ return self._specification.get(u"plots", list())
@property
def files(self):
@@ -210,7 +210,7 @@ class Specification:
:returns: List of specifications of files to be generated.
:rtype: list
"""
- return self._specification[u"files"]
+ return self._specification.get(u"files", list())
@property
def cpta(self):
@@ -614,6 +614,8 @@ class Specification:
idx = self._get_type_index(u"static")
if idx is None:
logging.warning(u"No static content specified.")
+ self._specification[u"static"] = dict()
+ return
for key, value in self._cfg_yaml[idx].items():
if isinstance(value, str):
@@ -816,10 +818,26 @@ class Specification:
logging.info(u"Parsing specification: INPUT")
- for data_set in self.data_sets.values():
- if data_set == "data-sets":
- continue
- for job, builds in data_set.items():
+ idx = self._get_type_index(u"input")
+ if idx is None:
+ logging.info(u"Creating the list of inputs from data sets.")
+ for data_set in self.data_sets.values():
+ if data_set == "data-sets":
+ continue
+ for job, builds in data_set.items():
+ for build in builds:
+ self.add_build(
+ job,
+ {
+ u"build": build,
+ u"status": None,
+ u"file-name": None,
+ u"source": None
+ }
+ )
+ else:
+ logging.info(u"Reading pre-defined inputs.")
+ for job, builds in self._cfg_yaml[idx][u"builds"].items():
for build in builds:
self.add_build(
job,