Skip to content
Snippets Groups Projects
Commit 154abd35 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

SW-806: local merge of origin/LOFAR-Release-4_0 into merged for...

SW-806: local merge of origin/LOFAR-Release-4_0 into merged for !40
parents 8c3dc08e 1e7eef59
No related branches found
No related tags found
No related merge requests found
......@@ -84,6 +84,21 @@ class BasicScheduler(object):
if self.starttime >= self.endtime:
raise ValueError('BasicScheduler, starttime=%s should be >= endtime=%s', self.starttime, self.endtime)
def __enter__(self):
self.open()
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.close()
def open(self):
""" Open radb connection"""
self.radb.connect()
def close(self):
""" Close radb connection"""
self.radb.disconnect()
def allocate_resources(self):
"""
Tries to allocate resources for the given estimates.
......@@ -496,19 +511,14 @@ class PriorityScheduler(StationScheduler):
def open(self):
""" Open connections to the required services """
super().open()
self.momqueryservice.open()
def close(self):
""" Close the connections with the used services """
super().close()
self.momqueryservice.close()
def __enter__(self):
self.open()
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.close()
def _pre_process_allocation(self):
""" Take care of actions to be taken prior to the scheduling of resources """
super(PriorityScheduler, self)._pre_process_allocation()
......
......@@ -40,5 +40,5 @@ class ResourceEstimatorRPC(RPCClientContextManagerMixin):
return ResourceEstimatorRPC(RPCClient(service_name=DEFAULT_RESOURCEESTIMATOR_SERVICENAME, exchange=exchange, broker=broker, timeout=timeout))
def get_estimated_resources(self, specification_tree: dict) -> dict:
return self._rpc_client.execute('get_estimated_resources')
return self._rpc_client.execute('get_estimated_resources', specification_tree=specification_tree)
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