From 60d2031ed6f7b34f81c28350d2d109c56f9d6e4c Mon Sep 17 00:00:00 2001 From: Ryunosuke O'Neil Date: Wed, 17 Dec 2025 15:42:48 +0100 Subject: [PATCH] feat: allow changing the InputDataPolicy in getInputDataCatalog chore: pre-commit fix --- src/DIRAC/Interfaces/API/Dirac.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/DIRAC/Interfaces/API/Dirac.py b/src/DIRAC/Interfaces/API/Dirac.py index b38cb47734f..3ceabcfc250 100755 --- a/src/DIRAC/Interfaces/API/Dirac.py +++ b/src/DIRAC/Interfaces/API/Dirac.py @@ -208,7 +208,9 @@ def preSubmissionChecks(self, job, mode): return S_OK("Nothing to do") ############################################################################# - def getInputDataCatalog(self, lfns, siteName="", fileName="pool_xml_catalog.xml", ignoreMissing=False): + def getInputDataCatalog( + self, lfns, siteName="", fileName="pool_xml_catalog.xml", ignoreMissing=False, inputDataPolicy=None + ): """This utility will create a pool xml catalogue slice for the specified LFNs using the full input data resolution policy plugins for the VO. @@ -228,6 +230,10 @@ def getInputDataCatalog(self, lfns, siteName="", fileName="pool_xml_catalog.xml" :type siteName: string :param fileName: Catalogue name (can include path) :type fileName: string + :param ignoreMissing: Flag to ignore missing files + :type ignoreMissing: bool + :param inputDataPolicy: Input data policy module to use + :type inputDataPolicy: string or None :returns: S_OK,S_ERROR """ @@ -248,9 +254,10 @@ def getInputDataCatalog(self, lfns, siteName="", fileName="pool_xml_catalog.xml" self.log.verbose(localSEList) - inputDataPolicy = Operations().getValue("InputDataPolicy/InputDataModule") if not inputDataPolicy: - return self._errorReport("Could not retrieve /DIRAC/Operations/InputDataPolicy/InputDataModule for VO") + inputDataPolicy = Operations().getValue("InputDataPolicy/InputDataModule") + if not inputDataPolicy: + return self._errorReport("Could not retrieve /DIRAC/Operations/InputDataPolicy/InputDataModule for VO") self.log.info(f"Attempting to resolve data for {siteName}") self.log.verbose("%s" % ("\n".join(lfns)))