ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/Processing/python/srm.py
Revision: 1.2
Committed: Wed Oct 19 10:43:12 2011 UTC (13 years, 6 months ago) by paus
Content type: text/x-python
Branch: MAIN
CVS Tags: Mit_025c_branch2, Mit_025c_branch1, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a
Branch point for: Mit_025c_branch
Changes since 1.1: +1 -1 lines
Log Message:
Updates realted to hadoop move of Tier-2.

File Contents

# Content
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 = 'se01.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