diff --git a/SAS/OTDB_Services/getParset.py b/SAS/OTDB_Services/getParset.py index d6abdae4ce719be7d5817a2b6f166518746795bc..ec26938ea778ce1971068d75a4492b23ba0543d3 100755 --- a/SAS/OTDB_Services/getParset.py +++ b/SAS/OTDB_Services/getParset.py @@ -25,9 +25,10 @@ """ from lofar.messaging.RPC import RPC +from lofar.sas.otdb.config import DEFAULT_OTDB_SERVICE_BUSNAME -def getParset(obsid, status, otdb_busname="lofar.otdb.command"): - with RPC("TaskSpecification", busname=otdb_busname, timeout=10) as parset_rpc: +def getParset(obsid, status, otdb_busname=DEFAULT_OTDB_SERVICE_BUSNAME): + with RPC("TaskGetSpecification", busname=otdb_busname, timeout=10) as parset_rpc: result, _ = parset_rpc(OtdbID=obsid) return result @@ -42,7 +43,7 @@ if __name__ == "__main__": # Check the invocation arguments parser = OptionParser("%prog -o obsid [options]") - parser.add_option("-B", "--busname", dest="busname", type="string", default="lofar.otdb.command", + parser.add_option("-B", "--busname", dest="busname", type="string", default=DEFAULT_OTDB_SERVICE_BUSNAME, help="Busname on which OTDB commands are sent") parser.add_option("-o", "--obsid", dest="obsid", type="int", default=0, help="Observation/tree ID to get parset of") diff --git a/SAS/OTDB_Services/setStatus.py b/SAS/OTDB_Services/setStatus.py index c3379282a3b9973f58f94845012feb73dc67bdef..2628bf8294c943ba9bd3f2aa74dd621b9ba469a6 100755 --- a/SAS/OTDB_Services/setStatus.py +++ b/SAS/OTDB_Services/setStatus.py @@ -25,9 +25,10 @@ """ from lofar.messaging.RPC import RPC +from lofar.sas.otdb.config import DEFAULT_OTDB_SERVICE_BUSNAME -def setStatus(obsid, status, otdb_busname="lofar.otdb.command"): - with RPC("StatusUpdateCmd", busname=otdb_busname, timeout=10) as status_rpc: +def setStatus(obsid, status, otdb_busname=DEFAULT_OTDB_SERVICE_BUSNAME): + with RPC("TaskSetStatus", busname=otdb_busname, timeout=10) as status_rpc: result, _ = status_rpc(OtdbID=obsid, NewStatus=status) if __name__ == "__main__": @@ -40,7 +41,7 @@ if __name__ == "__main__": # Check the invocation arguments parser = OptionParser("%prog -o obsid -s status [options]") - parser.add_option("-B", "--busname", dest="busname", type="string", default="lofar.otdb.command", + parser.add_option("-B", "--busname", dest="busname", type="string", default=DEFAULT_OTDB_SERVICE_BUSNAME, help="Busname on which OTDB commands are sent") parser.add_option("-o", "--obsid", dest="obsid", type="int", default=0, help="Observation/tree ID to set status for")