diff --git a/SAS/DataManagement/Cleanup/CleanupService/service.py b/SAS/DataManagement/Cleanup/CleanupService/service.py index c60b5a99634a60d53a1e95f214071ff93e01bb28..262d6c8db18ddce2149a6bc93769dbb4e9378b2f 100644 --- a/SAS/DataManagement/Cleanup/CleanupService/service.py +++ b/SAS/DataManagement/Cleanup/CleanupService/service.py @@ -178,11 +178,11 @@ class CleanupHandler(MessageHandlerInterface): momrpc = self.path_resolver.momrpc dataproducts = momrpc.getDataProducts(task['mom_id']).get(task['mom_id']) - ingestable_dataproducts = [dp for dp in dataproducts if dp['status'] not in [None, 'has_data', 'no_data', 'aborted'] ] - ingested_dataproducts = [dp for dp in dataproducts if dp['status'] == 'ingested'] + ingestable_dataproducts = [dp for dp in dataproducts if dp['status'] not in [None, 'has_data', 'no_data', 'aborted', 'populated'] ] + ingested_dataproducts = [dp for dp in ingestable_dataproducts if dp['status'] == 'ingested'] - if len(ingested_dataproducts) != len(dataproducts) and len(dataproducts) > 0 and len(ingestable_dataproducts) > 0: - logger.info('ingestable_dataproducts: %s', ingestable_dataproducts) + if len(ingestable_dataproducts) > 0 and len(ingested_dataproducts) < len(ingestable_dataproducts) : + uningested_dataproducts = [dp for dp in ingestable_dataproducts if dp['status'] != 'ingested'] message = "Task otdb_id=%s has un-ingested dataproducts. Not deleting data." % (task['otdb_id'],) logger.error(message) self._sendNotification(subject='TaskDeleted', content={'deleted': False, diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/mom.py b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/mom.py index 8ec68739deb2af16e57fa876b7fdca6c2869c2c3..41627a5257e26a7e77b2c98bedd7a40cbecd37d9 100644 --- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/mom.py +++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/mom.py @@ -106,7 +106,7 @@ def updateTaskMomDetails(task, momrpc): elif dp['status'] == 'aborted': num_ingest_aborted += 1 - ingestable_dataproducts = [dp for dp in dps if dp['status'] not in [None, 'has_data', 'no_data'] ] + ingestable_dataproducts = [dp for dp in dps if dp['status'] not in [None, 'has_data', 'no_data', 'aborted', 'populated'] ] if num_ingested > 0 and num_ingested == len(ingestable_dataproducts): t['ingest_status'] = 'ingested'