Skip to content
Snippets Groups Projects
Commit fc57fc60 authored by Ruud Beukema's avatar Ruud Beukema
Browse files

Task #10028: Fixed docstring

parent 74882498
No related branches found
No related tags found
No related merge requests found
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
# #
# $Id$ # $Id$
""" """
Daemon that listens to OTDB status changes to PRESCHEDULED and SCHEDULED, requests Daemon that listens to specific OTDB status changes, requests the parset of such jobs including their predecessors, and
the parset of such jobs (+ their predecessors), and posts them on the bus. posts them on the bus.
""" """
from lofar.messaging import FromBus, ToBus, EventMessage # RPC, from lofar.messaging import FromBus, ToBus, EventMessage # RPC,
...@@ -198,6 +198,7 @@ def resourceIndicatorsFromParset( parsetDict ): ...@@ -198,6 +198,7 @@ def resourceIndicatorsFromParset( parsetDict ):
return subset return subset
class RATaskSpecified(OTDBBusListener): class RATaskSpecified(OTDBBusListener):
def __init__(self, def __init__(self,
otdb_notification_busname=DEFAULT_OTDB_NOTIFICATION_BUSNAME, otdb_notification_busname=DEFAULT_OTDB_NOTIFICATION_BUSNAME,
...@@ -254,23 +255,23 @@ class RATaskSpecified(OTDBBusListener): ...@@ -254,23 +255,23 @@ class RATaskSpecified(OTDBBusListener):
otdb_id = id otdb_id = id
else: else:
logger.warning("Error in understanding id %s", id) logger.warning("Error in understanding id %s", id)
logger.info("Processing OTDB ID %s", otdb_id) logger.info("Processing OTDB ID %s", otdb_id)
result = {"otdb_id": otdb_id, "predecessors": []} result = {"otdb_id": otdb_id, "predecessors": []}
if state: if state:
result["state"] = state # TODO should be status not state result["state"] = state # TODO should be status not state
else: else:
pass #otdbrpc.taskGetStatus not implemented and maybe not needed? pass #otdbrpc.taskGetStatus not implemented and maybe not needed?
if otdb_id in found_parsets: if otdb_id in found_parsets:
parset = found_parsets[otdb_id] parset = found_parsets[otdb_id]
else: else:
parset = self.otdbrpc.taskGetSpecification( otdb_id=otdb_id )['specification'] parset = self.otdbrpc.taskGetSpecification( otdb_id=otdb_id )['specification']
found_parsets[otdb_id] = parset found_parsets[otdb_id] = parset
logger.info("parset [%s]: %s" % (otdb_id, parset)) logger.info("parset [%s]: %s" % (otdb_id, parset))
result['specification'] = resourceIndicatorsFromParset(parset) result['specification'] = resourceIndicatorsFromParset(parset)
key = PARSET_PREFIX + "Observation.processSubtype" key = PARSET_PREFIX + "Observation.processSubtype"
result['task_type'], result['task_subtype'] = convertSchedulerProcessSubtype(parset.get(key, "")) result['task_type'], result['task_subtype'] = convertSchedulerProcessSubtype(parset.get(key, ""))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment