ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/DLSInfo.py
Revision: 1.3
Committed: Sun Dec 11 18:51:17 2005 UTC (19 years, 4 months ago) by afanfani
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_1_0_4, CRAB_1_0_3
Changes since 1.2: +5 -4 lines
Log Message:
use the CERN DLS server lxgate10.cern.ch

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 afanfani 1.3 self.DLSServer_ = 'lxgate10.cern.ch'
20     self.DLSServerPort_ = '18081'
21     #self.DLSServerPort_ = '18080'
22 afanfani 1.1
23     # ####################################
24     def getReplicas(self):
25     """
26     query DLS to get replicas
27     """
28 afanfani 1.3 ##
29     cmd = self.DLSclient_+" --port "+self.DLSServerPort_+" --host "+self.DLSServer_+" --datablock "+self.fileblocks
30 afanfani 1.1 sites = runCommand(cmd)
31 afanfani 1.2 ListSites=string.split(string.strip(sites),'\n')
32 afanfani 1.1 return ListSites