diff --git a/LCS/Messaging/python/messaging/test/t_RPC.py b/LCS/Messaging/python/messaging/test/t_RPC.py index 4b367e253b046306f332c3f19f4c4f01fe03e6f1..95f9331714162c7908b192330d5b931e18ffb2cd 100644 --- a/LCS/Messaging/python/messaging/test/t_RPC.py +++ b/LCS/Messaging/python/messaging/test/t_RPC.py @@ -110,11 +110,11 @@ if __name__ == '__main__': busname = sys.argv[1] if len(sys.argv) > 1 else "simpletest" # Register functs as a service handler listening at busname and ServiceName - serv1 = Service(busname, "ErrorService", ErrorFunc, numthreads=1) - serv2 = Service(busname, "ExceptionService", ExceptionFunc, numthreads=1) - serv3 = Service(busname, "StringService", StringFunc, numthreads=1) - serv4 = Service(busname, "ListService", ListFunc, numthreads=1) - serv5 = Service(busname, "DictService", DictFunc, numthreads=1) + serv1 = Service("ErrorService", ErrorFunc, busname=busname, numthreads=1) + serv2 = Service("ExceptionService", ExceptionFunc, busname=busname, numthreads=1) + serv3 = Service("StringService", StringFunc, busname=busname, numthreads=1) + serv4 = Service("ListService", ListFunc, busname=busname, numthreads=1) + serv5 = Service("DictService", DictFunc, busname=busname, numthreads=1) # 'with' sets up the connection context and defines the scope of the service. with serv1, serv2, serv3, serv4, serv5: @@ -127,21 +127,21 @@ if __name__ == '__main__': # Redo all tests but via through RPC # ErrorFunc - with RPC(busname, "ErrorService") as rpc: + with RPC("ErrorService", busname=busname) as rpc: try: result = rpc("aap noot mies") except UserException as e: pass # ExceptionFunc - with RPC(busname, "ExceptionService") as rpc: + with RPC("ExceptionService", busname=busname) as rpc: try: result = rpc("aap noot mies") except IndexError as e: pass # StringFunc - with RPC(busname, "StringService") as rpc: + with RPC("StringService", busname=busname) as rpc: try: result = rpc([25]) except InvalidArgType as e: @@ -151,7 +151,7 @@ if __name__ == '__main__': raise Exception("String function failed:{}".format(result)) # ListFunc - with RPC(busname, "ListService") as rpc: + with RPC("ListService", busname=busname) as rpc: try: result = rpc("25") except InvalidArgType as e: @@ -161,7 +161,7 @@ if __name__ == '__main__': raise Exception("List function failed:{}".format(result)) # DictFunc - with RPC(busname, "DictService") as rpc: + with RPC("DictService", busname=busname) as rpc: try: result = rpc([25]) except InvalidArgType as e: diff --git a/SAS/OTDB_Services/TreeService.py b/SAS/OTDB_Services/TreeService.py index 77b1212238e7db7cf73b5857dfda95874ad41fe4..ce27dc471fd9e6d5e31dbc269193e076f1b4759f 100644 --- a/SAS/OTDB_Services/TreeService.py +++ b/SAS/OTDB_Services/TreeService.py @@ -210,7 +210,7 @@ class PostgressMessageHandlerInterface(MessageHandlerInterface): self.connection = None self.connected = False - def in_loop_before_receive(self): + def prepare_receive(self): "Called in main processing loop just before a blocking wait for messages is done." "Make sure we are connected with the database." self.connected = (self.connection and self.connection.status == 1)