diff --git a/SAS/ResourceAssignment/RATaskSpecifiedService/lib/RATaskSpecified.py b/SAS/ResourceAssignment/RATaskSpecifiedService/lib/RATaskSpecified.py index 272145aa4ff1a6491bf97898ce9b7e03e04023ab..e8bb6e443ab7deccb44866292dbe472a7f92d490 100755 --- a/SAS/ResourceAssignment/RATaskSpecifiedService/lib/RATaskSpecified.py +++ b/SAS/ResourceAssignment/RATaskSpecifiedService/lib/RATaskSpecified.py @@ -21,8 +21,8 @@ # # $Id$ """ -Daemon that listens to OTDB status changes to PRESCHEDULED and SCHEDULED, requests -the parset of such jobs (+ their predecessors), and posts them on the bus. +Daemon that listens to specific OTDB status changes, requests the parset of such jobs including their predecessors, and +posts them on the bus. """ from lofar.messaging import FromBus, ToBus, EventMessage # RPC, @@ -198,6 +198,7 @@ def resourceIndicatorsFromParset( parsetDict ): return subset + class RATaskSpecified(OTDBBusListener): def __init__(self, otdb_notification_busname=DEFAULT_OTDB_NOTIFICATION_BUSNAME, @@ -254,23 +255,23 @@ class RATaskSpecified(OTDBBusListener): otdb_id = id else: logger.warning("Error in understanding id %s", id) - + logger.info("Processing OTDB ID %s", otdb_id) - result = {"otdb_id": otdb_id, "predecessors": []} + result = {"otdb_id": otdb_id, "predecessors": []} if state: result["state"] = state # TODO should be status not state else: pass #otdbrpc.taskGetStatus not implemented and maybe not needed? - + if otdb_id in found_parsets: parset = found_parsets[otdb_id] else: parset = self.otdbrpc.taskGetSpecification( otdb_id=otdb_id )['specification'] found_parsets[otdb_id] = parset - + logger.info("parset [%s]: %s" % (otdb_id, parset)) result['specification'] = resourceIndicatorsFromParset(parset) - + key = PARSET_PREFIX + "Observation.processSubtype" result['task_type'], result['task_subtype'] = convertSchedulerProcessSubtype(parset.get(key, ""))