Commit 0187de99 authored by Mitar's avatar Mitar

Validate that primitives have unique ID.

Fixes #34.
parent e6c250e8
Pipeline #99034516 canceled with stages
in 1 minute and 12 seconds
......@@ -78,7 +78,14 @@ def process_interface_version(interface_version):
with open(primitive_annotation_path, 'r', encoding='utf8') as primitive_annotation_file:
primitive_annotation = json.load(primitive_annotation_file)
known_primitives[primitive_annotation['id']] = primitive_annotation
if primitive_annotation['id'] in known_primitives:
error = True
print("Error: Duplicate primitive IDs, '{first_python_path}' vs. '{second_python_path}'.".format(
first_python_path=known_primitives[primitive_annotation['id']]['python_path'],
second_python_path=primitive_annotation['python_path'],
), flush=True)
else:
known_primitives[primitive_annotation['id']] = primitive_annotation
except Exception:
print("Error at primitive '{primitive_annotation_path}'.".format(primitive_annotation_path=primitive_annotation_path), flush=True)
traceback.print_exc()
......@@ -101,7 +108,7 @@ def process_interface_version(interface_version):
pipeline = resolve_pipeline(pipelines_dir, pipeline_id)
except PipelineNotFoundError:
error = True
print("Could not resolve pipeline '{pipeline_id}' in '{pipelines_dir}' for pipeline run '{pipeline_run}'.".format(
print("Error: Could not resolve pipeline '{pipeline_id}' in '{pipelines_dir}' for pipeline run '{pipeline_run}'.".format(
pipeline_id=pipeline_id,
pipelines_dir=pipelines_dir,
pipeline_run=pipeline_run,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment