Skip to content
Snippets Groups Projects
Commit 9c47bc2e authored by Jan David Mol's avatar Jan David Mol
Browse files

TMSS-710: Fixed syntax error and resolving references to root in resolve_path.

parent f42deaf1
No related branches found
No related tags found
3 merge requests!634WIP: COBALT commissioning delta,!498TMSS-710: Implement pulp feedback, and overhaul generation of pulp output dataproducts,!481Draft: SW-971 SW-973 SW-975: Various fixes to build LOFAR correctly.
...@@ -163,11 +163,15 @@ def resolve_path(schema, reference: str): ...@@ -163,11 +163,15 @@ def resolve_path(schema, reference: str):
parts = reference.strip('/').split('/') parts = reference.strip('/').split('/')
subschema = schema subschema = schema
if parts == ['']:
# reference to root
return schema
try: try:
for part in parts: for part in parts:
subschema = subschema[part] subschema = subschema[part]
except KeyError as e: except KeyError as e:
raise KeyError("Could not resolve path %s in schema %s" % (path, schema)) from e raise KeyError("Could not resolve path %s in schema %s" % (reference, schema)) from e
return subschema return subschema
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment