diff --git a/SAS/ResourceAssignment/ResourceAssigner/lib/schedulechecker.py b/SAS/ResourceAssignment/ResourceAssigner/lib/schedulechecker.py index c8944e64df6a571bab0b886f357731f94ea57a6f..e61b49cfaaee4b3a7eca35012645c67501c30583 100644 --- a/SAS/ResourceAssignment/ResourceAssigner/lib/schedulechecker.py +++ b/SAS/ResourceAssignment/ResourceAssigner/lib/schedulechecker.py @@ -73,13 +73,13 @@ def movePipelineAfterItsPredecessors(task, radbrpc, min_start_timestamp=None): if shift != timedelta(seconds=0): logger.info("Moving %s pipeline radb_id=%s otdb_id=%s by %s from \'%s\' to \'%s\'", task['status'], task['id'], task['otdb_id'], format_timedelta(shift), task['starttime'], newStartTime) if not radbrpc.updateTaskAndResourceClaims(task['id'], starttime=newStartTime, endtime=newEndTime): - logger.warn("Could not update start/endtime for pipeline radb_id=%s otdb_id=%s", + logger.warning("Could not update start/endtime for pipeline radb_id=%s otdb_id=%s", updated_task['id'], updated_task['otdb_id']) updated_task = radbrpc.getTask(task['id']) if updated_task['status'] != task['status']: - logger.warn("Moving of pipeline radb_id=%s otdb_id=%s caused the status to change from %s to %s", updated_task['id'], updated_task['otdb_id'], task['status'], updated_task['status']) + logger.warning("Moving of pipeline radb_id=%s otdb_id=%s caused the status to change from %s to %s", updated_task['id'], updated_task['otdb_id'], task['status'], updated_task['status']) #TODO: automatically resolve conflict status by moved pipeline in first free time slot. except Exception as e: logger.error("Error while checking pipeline starttime: %s", e) @@ -87,16 +87,16 @@ def movePipelineAfterItsPredecessors(task, radbrpc, min_start_timestamp=None): class ScheduleChecker(): def __init__(self, - busname=DEFAULT_BUSNAME, + exchange=DEFAULT_BUSNAME, broker=DEFAULT_BROKER): """ """ self._thread = None self._running = False - self._radbrpc = RADBRPC.create(exchange=busname, broker=broker) - self._momrpc = MoMQueryRPC.create(exchange=busname, broker=broker) - self._curpc = CleanupRPC.create(exchange=busname, broker=broker) - self._otdbrpc = OTDBRPC.create(exchange=busname, broker=broker, timeout=180) + self._radbrpc = RADBRPC.create(exchange=exchange, broker=broker) + self._momrpc = MoMQueryRPC.create(exchange=exchange, broker=broker) + self._curpc = CleanupRPC.create(exchange=exchange, broker=broker) + self._otdbrpc = OTDBRPC.create(exchange=exchange, broker=broker, timeout=180) def __enter__(self): """Internal use only. (handles scope 'with')""" @@ -127,7 +127,6 @@ class ScheduleChecker(): self._running = False self._thread.join(60) - def checkRunningPipelines(self): """ Update the end time of pipelines if they are running beyond their scheduled end time. """