From c2c0cd3a528339bb742f39cdfb8bcadb56b51453 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Wed, 18 May 2016 09:08:35 +0000
Subject: [PATCH] Task #8437: Updated bus and service names in
 getParset/setStatus scripts

---
 SAS/OTDB_Services/getParset.py | 7 ++++---
 SAS/OTDB_Services/setStatus.py | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/SAS/OTDB_Services/getParset.py b/SAS/OTDB_Services/getParset.py
index d6abdae4ce7..ec26938ea77 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 c3379282a3b..2628bf8294c 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")
-- 
GitLab