ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/DLSInfo.py
Revision: 1.2
Committed: Tue Nov 8 13:27:55 2005 UTC (19 years, 5 months ago) by afanfani
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_1_0_2, CRAB_0_2_2
Changes since 1.1: +1 -1 lines
Log Message:
fix in the list of sites

File Contents

# Content
1 #!/usr/bin/env python
2 import sys, os, commands,string, re
3 from crab_util import *
4 import common
5
6 class DLSError:
7 def __init__(self, fileblocks):
8 print '\nERROR accessing DLS for fileblock '+fileblocks+'\n'
9 pass
10
11 ##############################################################################
12 # Class to extract info from DLS
13 ##############################################################################
14
15 class DLSInfo:
16 def __init__(self, fileblocks):
17 self.fileblocks = fileblocks
18 self.DLSclient_ = 'DLSAPI/dls-get-se '
19 self.DLSServer_ = 'cmsbogw.bo.infn.it'
20
21 # ####################################
22 def getReplicas(self):
23 """
24 query DLS to get replicas
25 """
26 ##
27 cmd = self.DLSclient_+" --host "+self.DLSServer_+" --datablock "+self.fileblocks
28 #print cmd
29 sites = runCommand(cmd)
30 ListSites=string.split(string.strip(sites),'\n')
31 return ListSites