Skip to content

Commit

Permalink
Merge pull request #9 from NASA-PDS/i2
Browse files Browse the repository at this point in the history
Raise FileNotFoundError when IngestLDD is missing
  • Loading branch information
jordanpadams authored Mar 22, 2024
2 parents 0a3f6ac + d3df806 commit 26eae72
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pds/ldd_manager/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ def generate_ldds_with_dependencies(src_path, sw_dir, lddtool_args, ldd_output_p
NOTE: Requires `git submodule update --init --force --remote` to be run on all dependent LDDs in advance
"""
primary_ingest_ldds = LDDs.find_primary_ingest_ldd(src_path)
if not primary_ingest_ldds:
raise FileNotFoundError(
"No IngestLDD found in src/. Verify filename matches expected pattern: PDS4_<namespace>_IngestLDD.xml"
)

ingest_ldds = []
dependent_ingest_ldds = LDDs.find_dependency_ingest_ldds(src_path)
for ingest in dependent_ingest_ldds:
Expand All @@ -69,7 +75,7 @@ def generate_ldds_with_dependencies(src_path, sw_dir, lddtool_args, ldd_output_p
)
)

ingest_ldds.extend(LDDs.find_primary_ingest_ldd(src_path))
ingest_ldds.extend(primary_ingest_ldds)
_logger.info(f"Primary LDD: {LDDs.find_primary_ingest_ldd(src_path)}")
_logger.info(f"Dependent LDDs: {ingest_ldds}")

Expand Down

0 comments on commit 26eae72

Please sign in to comment.