ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/Processing/python/srm.py
Revision: 1.1
Committed: Thu Oct 13 14:38:41 2011 UTC (13 years, 6 months ago) by paus
Content type: text/x-python
Branch: MAIN
Log Message:
Adding the srm dressing.

File Contents

# User Rev Content
1 paus 1.1 #---------------------------------------------------------------------------------------------------
2     # Python Module File to translate storage/computing elements into meta site names
3     #
4     # Author: C.Paus (Jun 16, 2010)
5     #---------------------------------------------------------------------------------------------------
6     import os,sys,re,string
7    
8     def convertToUrl(dir,debug):
9     if re.search('/castor/cern.ch/', dir):
10     storageEle = 'srm-cms.cern.ch'
11     storagePath = '/srm/managerv2?SFN='
12     elif re.search('/pnfs/cmsaf.mit.edu/', dir):
13     storageEle = 'se01.cmsaf.mit.edu'
14     storagePath = '/srm/managerv2?SFN='
15     elif re.search('/mnt/hadoop/cms/store',dir):
16     storageEle = 'se02.cmsaf.mit.edu'
17     storagePath = '/srm/v2/server?SFN='
18     else:
19     storageEle = ''
20     storagePath = ''
21    
22     if storageEle == '':
23     storageUrl = dir
24     else:
25     storageUrl = 'srm://' + storageEle + ':8443' + storagePath + dir
26    
27     if debug:
28     print " DEBUG (srm.py): " + storageUrl
29    
30     return storageUrl