From a8adaf935914cd771232bc2eace1e2fcf043bf67 Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Tue, 14 May 2019 11:52:15 +0000 Subject: [PATCH] SW-699: Added missing imports, various typos and small errors --- LTA/LTAIngest/LTAIngestClient/lib/ingestbuslistener.py | 2 +- MAC/Services/src/PipelineControl.py | 2 +- SAS/DataManagement/StorageQueryService/service.py | 2 +- SAS/OTDB_Services/TreeService.py | 5 +++-- SAS/OTDB_Services/otdbrpc.py | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/LTA/LTAIngest/LTAIngestClient/lib/ingestbuslistener.py b/LTA/LTAIngest/LTAIngestClient/lib/ingestbuslistener.py index 8564a0d22ce..47bf96d13a6 100644 --- a/LTA/LTAIngest/LTAIngestClient/lib/ingestbuslistener.py +++ b/LTA/LTAIngest/LTAIngestClient/lib/ingestbuslistener.py @@ -43,7 +43,7 @@ class IngestBusListener(AbstractBusListener): numthreads= <int> Number of parallel threads processing messages (default: 1) verbose= <bool> Output extra logging over stdout (default: False) """ - super(IngestBusListener, self).__init__(address=address, subject=DEFAULT_INGEST_NOTIFICATION_PREFIX+"#", broker=broker, **kwargs) + super(IngestBusListener, self).__init__(address=busname, subject=DEFAULT_INGEST_NOTIFICATION_PREFIX+"#", broker=broker, **kwargs) def _handleMessage(self, msg): diff --git a/MAC/Services/src/PipelineControl.py b/MAC/Services/src/PipelineControl.py index b02f62f5f25..8a52561cac7 100755 --- a/MAC/Services/src/PipelineControl.py +++ b/MAC/Services/src/PipelineControl.py @@ -66,7 +66,7 @@ The execution chains are as follows: a cascade of job terminations of successor pipelines. """ -from lofar.messaging import FromBus, ToBus, RPC, EventMessage, DEFAULT_BUSNAME +from lofar.messaging import FromBus, ToBus, RPC, EventMessage, DEFAULT_BUSNAME, DEFAULT_BROKER from lofar.parameterset import PyParameterValue from lofar.sas.otdb.OTDBBusListener import OTDBBusListener from lofar.sas.otdb.otdbrpc import OTDBRPC diff --git a/SAS/DataManagement/StorageQueryService/service.py b/SAS/DataManagement/StorageQueryService/service.py index 73ea1722c04..68ae6f32b59 100644 --- a/SAS/DataManagement/StorageQueryService/service.py +++ b/SAS/DataManagement/StorageQueryService/service.py @@ -82,7 +82,7 @@ def main(): level=logging.DEBUG if options.verbose else logging.INFO) setQpidLogLevel(logging.INFO) - with CacheManager(busname=busname, broker=options.broker, cache_path=options.cache_path) as cache_manager: + with CacheManager(busname=options.busname, broker=options.broker, cache_path=options.cache_path) as cache_manager: with createService(busname=options.busname, broker=options.broker, verbose=options.verbose, diff --git a/SAS/OTDB_Services/TreeService.py b/SAS/OTDB_Services/TreeService.py index 64b0d5a59e3..86ce8f988e1 100755 --- a/SAS/OTDB_Services/TreeService.py +++ b/SAS/OTDB_Services/TreeService.py @@ -43,7 +43,9 @@ import sys, time, pg import logging from datetime import datetime from lofar.messaging.Service import * +from lofar.messaging import DEFAULT_BROKER, DEFAULT_BUSNAME from lofar.common.util import waitForInterrupt +from .config import DEFAULT_OTDB_SERVICENAME QUERY_EXCEPTIONS = (TypeError, ValueError, MemoryError, pg.ProgrammingError, pg.InternalError) @@ -671,8 +673,7 @@ def main(): from optparse import OptionParser from lofar.common import dbcredentials from lofar.common.util import waitForInterrupt - from lofar.sas.otdb.config import DEFAULT_OTDB_SERVICENAME - from lofar.messaging import setQpidLogLevel, DEFAULT_BUSNAME + from lofar.messaging import setQpidLogLevel # Check the invocation arguments parser = OptionParser("%prog [options]") diff --git a/SAS/OTDB_Services/otdbrpc.py b/SAS/OTDB_Services/otdbrpc.py index cc0458c5a66..6655fab728c 100644 --- a/SAS/OTDB_Services/otdbrpc.py +++ b/SAS/OTDB_Services/otdbrpc.py @@ -111,7 +111,7 @@ class OTDBRPC(RPCWrapper): def do_tests(busname=DEFAULT_BUSNAME): - with OTDBRPC(busname=busname, servicename=servicename, broker='10.149.96.6') as rpc: + with OTDBRPC(busname=busname, broker='10.149.96.6') as rpc: print(rpc.taskGetStatus(452728)) if __name__ == '__main__': -- GitLab