From feb0dcaeded0a10e0f62d5d6d60f14a5abb53075 Mon Sep 17 00:00:00 2001
From: chausman <chausman@nrao.edu>
Date: Thu, 26 Oct 2023 12:28:14 -0600
Subject: [PATCH] implement ingestNGAS flag only on EB ingestion (VLBA/GMVA
 currently)

---
 .../ingest_envoy/ingest_envoy/ingestion_manifest.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/ingestion_manifest.py b/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/ingestion_manifest.py
index a61ef6d71..ce750a5b4 100644
--- a/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/ingestion_manifest.py
+++ b/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/ingestion_manifest.py
@@ -129,6 +129,19 @@ class IngestionManifest(ManifestComponentIF):
 
         return flag
 
+    def get_ngas_flag(self) -> bool:
+        """Determine and retrieve the correct ingestNGAS flag for this type of ingestion/curation"""
+
+        # default to true for all types
+        flag = True
+        # TODO: Add properties for other types
+        if self.sp_type == ScienceProductType.EXEC_BLOCK:
+            # EB ingestion might create duplicate file versions during testing, check flag state
+            if self.telescope == Telescope.VLBA or self.telescope == Telescope.GMVA:
+                flag = CapoConfig().getboolean("archive-ingestion.ingestNGAS")
+
+        return flag
+
     def build_ingest_parameters(self, additional_metadata: AbstractTextFile):
         """
         Make the "parameters" section of the manifest
-- 
GitLab