Commit 3e8e65dd authored by Philip ABBET's avatar Philip ABBET

[executor] Add more checks to ensure the JSON configuration is valid

parent 3c0ca8ab
......@@ -183,6 +183,24 @@ class BaseExecutor(object):
self.errors += self.algorithm.errors
# Check that the mapping in coherent
if len(['inputs']) != len(self.algorithm.input_map):
self.errors.append("The number of inputs of the algorithm doesn't correspond")
if len(['outputs']) != len(self.algorithm.output_map):
self.errors.append("The number of outputs of the algorithm doesn't correspond")
for name in['inputs'].keys():
if name not in self.algorithm.input_map.keys():
self.errors.append("The input '%s' doesn't exist in the algorithm" % name)
for name in['outputs'].keys():
if name not in self.algorithm.output_map.keys():
self.errors.append("The output '%s' doesn't exist in the algorithm" % name)
if self.errors:
# Load the databases (if any is required)
for name, details in['inputs'].items():
if 'database' in details:
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment