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

SW-283: pass along the srm_url from the dataproduct notification to the task...

SW-283: pass along the srm_url from the dataproduct notification to the task notification if possible
parent 9930d242
No related branches found
No related tags found
No related merge requests found
...@@ -247,6 +247,17 @@ class IngestMomAdapter: ...@@ -247,6 +247,17 @@ class IngestMomAdapter:
if key in job_dict: if key in job_dict:
job_dict2[key] = job_dict[key] job_dict2[key] = job_dict[key]
if 'srm_url' in job_dict:
try:
# try to parse the srm_url and get the observation dir name from the dataproduct srmurl
# example url: srm://lofar-srm.fz-juelich.de:8443/pnfs/fz-juelich.de/data/lofar/ops/projects/lc8_029/652884/L652884_SAP000_B000_P001_bf_e619e5da.tar
# should become: srm://lofar-srm.fz-juelich.de:8443/pnfs/fz-juelich.de/data/lofar/ops/projects/lc8_029/652884
srm_url = job_dict['srm_url']
srm_dir_url = '/'.join(srm_url.split('/')[:-2])
job_dict2['srm_url'] = srm_dir_url
except Exception as e:
logger.error("could not derive srm_dir_url from %s. error=%s", srm_url, e)
message = 'Ingested %s/%s (%.1f%%) dataproducts for otdb_id %s mom2id %s' % (len(ingested_dps), message = 'Ingested %s/%s (%.1f%%) dataproducts for otdb_id %s mom2id %s' % (len(ingested_dps),
len(dps), len(dps),
100.0*len(ingested_dps)/len(dps), 100.0*len(ingested_dps)/len(dps),
......
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