ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/DLSInfo.py
Revision: 1.1
Committed: Mon Nov 7 23:20:21 2005 UTC (19 years, 5 months ago) by afanfani
Content type: text/x-python
Branch: MAIN
Log Message:
extract info from DLS using dls prototype command-line

File Contents

# User Rev Content
1 afanfani 1.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(sites,'\n')
31     return ListSites