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

TMSS-2836: skip idols. skip lofar2 units

parent 71b30bdc
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,18 @@ class TMSSLofar2SiblingEventMessageHandler(TMSSEventMessageHandler):
self.tmss_client.close()
def onSchedulingUnitBlueprintCreated(self, id: int):
scheduling_unit = self.tmss_client.get_schedulingunit_blueprint(id, slim=True)
if scheduling_unit['project'].lower().strip() == 'idols':
logger.info("skipping creation of lofar2 sibling for idols unit id=%s", id)
return
stations = self.tmss_client.get_stations()
lofar2_stations = set([station for station, props in stations.items() if props['version']==2])
if set(scheduling_unit['specified_stations']) == lofar2_stations:
logger.info("skipping creation of lofar2 sibling for unit id=%s which is already using lofar2 stations", id)
return
lofar2_unit = self.tmss_client.create_lofar2_sibling_scheduling_unit(id)
if lofar2_unit is not None:
logger.info("created lofar2 unit: %s", lofar2_unit['url'])
......
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