ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/Processing/python/srm.py
Revision: 1.3
Committed: Thu Aug 9 21:16:04 2012 UTC (12 years, 9 months ago) by paus
Content type: text/x-python
Branch: MAIN
CVS Tags: Mit_032, Mit_031, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, HEAD
Changes since 1.2: +0 -3 lines
Log Message:
For version 029.

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('/mnt/hadoop/cms/store',dir):
13 paus 1.2 storageEle = 'se01.cmsaf.mit.edu'
14 paus 1.1 storagePath = '/srm/v2/server?SFN='
15     else:
16     storageEle = ''
17     storagePath = ''
18    
19     if storageEle == '':
20     storageUrl = dir
21     else:
22     storageUrl = 'srm://' + storageEle + ':8443' + storagePath + dir
23    
24     if debug:
25     print " DEBUG (srm.py): " + storageUrl
26    
27     return storageUrl