File indexing completed on 2026-04-10 08:38:59
0001 from .PostProcessorBase import PostProcessorBase
0002
0003
0004
0005 class GenPostProcessor(PostProcessorBase):
0006
0007 def __init__(self, taskBufferIF, ddmIF):
0008 PostProcessorBase.__init__(self, taskBufferIF, ddmIF)
0009 self.failOnZeroOkFile = True
0010
0011
0012 def doPostProcess(self, taskSpec, tmpLog):
0013 try:
0014
0015 ddmIF = self.ddmIF.getInterface(taskSpec.vo, taskSpec.cloud)
0016
0017 if not ddmIF:
0018 tmpLog.info("skip due to inactive DDM I/F")
0019 else:
0020
0021 for datasetSpec in taskSpec.datasetSpecList:
0022
0023 if datasetSpec.type not in ["log", "output"]:
0024 continue
0025 tmpLog.info(f"freezing datasetID={datasetSpec.datasetID}:Name={datasetSpec.datasetName}")
0026 ddmIF.freezeDataset(datasetSpec.datasetName, ignoreUnknown=True)
0027 except Exception as e:
0028 tmpLog.warning(f"failed to freeze datasets with {str(e)}")
0029 return self.SC_FAILED
0030 try:
0031 self.doBasicPostProcess(taskSpec, tmpLog)
0032 except Exception as e:
0033 tmpLog.error(f"doBasicPostProcess failed with {str(e)}")
0034 return self.SC_FATAL
0035 return self.SC_SUCCEEDED