diff --git a/SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/propagator.py b/SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/propagator.py index edfb3b1c37a1091ee9656acd356be2c9dafff17c..42cf5c22b21415f0597e49dbaf80b1eb39433fd6 100755 --- a/SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/propagator.py +++ b/SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/propagator.py @@ -28,6 +28,7 @@ reads the info from the RA DB and sends it to OTDB in the correct format. import logging import datetime import time +import pprint from lofar.messaging.RPC import RPC, RPCException from lofar.parameterset import parameterset @@ -147,11 +148,10 @@ class RAtoOTDBPropagator(): project_name = 'unknown' otdb_info = self.translator.CreateParset(otdb_id, ra_info, project_name) - logger.info("Parset info for OTDB: %s" %otdb_info) self.setOTDBinfo(otdb_id, otdb_info, 'scheduled') except Exception as e: logger.error(e) - self.doTaskConflict(otdb_id) + self.doTaskError(otdb_id) #FIXME should be to the RADB also or instead? def ParseStorageProperties(self, storage_claim): """input something like: @@ -200,7 +200,7 @@ class RAtoOTDBPropagator(): result['output_files'][p['type_name']] = p['value'] if p['io_type_name'] == 'input': result['input_files'][p['type_name']] = p['value'] - logging.info(result) + logger.info(pprint.pformat(result)) return result def getRAinfo(self, ra_id): @@ -209,7 +209,7 @@ class RAtoOTDBPropagator(): task = self.radbrpc.getTask(ra_id) claims = self.radbrpc.getResourceClaims(task_ids=ra_id, extended=True, include_properties=True) for claim in claims: - logger.debug("Processing claim: %s" % claim) + logger.info("Processing claim: %s" % claim) if claim['resource_type_name'] == 'storage': ## TODO we will need to check for different storage names/types in the future info['storage'] = self.ParseStorageProperties(claim) info["starttime"] = task["starttime"] @@ -220,11 +220,12 @@ class RAtoOTDBPropagator(): def setOTDBinfo(self, otdb_id, otdb_info, otdb_status): try: - logger.info('Setting specticication for otdb_id %s: %s' % (otdb_id, otdb_info)) + logger.info('Setting specticication for otdb_id %s:\n' % (otdb_id,)) + logger.info(pprint.pformat(otdb_info)) self.otdbrpc.taskSetSpecification(otdb_id, otdb_info) self.otdbrpc.taskPrepareForScheduling(otdb_id, otdb_info["LOFAR.ObsSW.Observation.startTime"], otdb_info["LOFAR.ObsSW.Observation.stopTime"]) logger.info('Setting status (%s) for otdb_id %s' % (otdb_status, otdb_id)) self.otdbrpc.taskSetStatus(otdb_id, otdb_status) except Exception as e: logger.error(e) - self.doTaskConflict(otdb_id) + self.doTaskError(otdb_id) #FIXME should be to the RADB also or instead? diff --git a/SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/translator.py b/SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/translator.py index 8cbd4ac388fcfd5a45287ed45bcee1de577d6505..aa8b6566a38cb21921442bbf7000a612849c4faf 100755 --- a/SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/translator.py +++ b/SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/translator.py @@ -26,6 +26,7 @@ reads the info from the RA DB and sends it to OTDB in the correct format. """ import logging +import pprint from lofar.common.util import to_csv_string from math import ceil, floor @@ -199,7 +200,7 @@ class RAtoOTDBTranslator(): return result def ProcessStorageInfo(self, otdb_id, storage_info, project_name): - logging.debug('processing the storage for %i with ' % (otdb_id) + str(storage_info)) + logging.info('processing the storage for %i' % (otdb_id)) result = {} if 'input_files' in storage_info: result.update(self.CreateStorageKeys(otdb_id, storage_info['input_files'], project_name, "Input")) @@ -216,7 +217,7 @@ class RAtoOTDBTranslator(): parset[PREFIX+'stopTime'] = ra_info['endtime'].strftime('%Y-%m-%d %H:%M:%S') if 'storage' in ra_info: - logging.info("Adding storage claims to parset: " + str(ra_info['storage'])) + logging.info("Adding storage claims to parset\n" + pprint.pformat(ra_info['storage']))) parset.update(self.ProcessStorageInfo(otdb_id, ra_info['storage'], project_name)) if 'stations' in ra_info: logging.info("Adding stations to parset: " + str(ra_info["stations"])) diff --git a/SAS/ResourceAssignment/ResourceAssignmentEstimator/service.py b/SAS/ResourceAssignment/ResourceAssignmentEstimator/service.py index 3914ac7fc92461f4d17962d5762d3db863e9b851..20453311d0eefb357187537ba1ef58a04867e106 100644 --- a/SAS/ResourceAssignment/ResourceAssignmentEstimator/service.py +++ b/SAS/ResourceAssignment/ResourceAssignmentEstimator/service.py @@ -5,7 +5,8 @@ Simple Service listening ''' -import logging, pprint +import logging +import pprint from lofar.messaging import Service from lofar.messaging.Service import MessageHandlerInterface