ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/ServerConfig.py
(Generate patch)

Comparing COMP/CRAB/python/ServerConfig.py (file contents):
Revision 1.5 by farinafa, Wed Mar 26 18:25:59 2008 UTC vs.
Revision 1.6 by farinafa, Wed Apr 2 08:00:36 2008 UTC

# Line 10 | Line 10 | class ServerConfig:
10      def __init__(self, serverName):
11          common.logger.debug(5,'Calling ServerConfig')
12          self.url = 'http://cmsdoc.cern.ch/cms/ccs/wm/www/Crab/useful_script/Server_conf/'
13 <        self.configFileName = 'server_%s.conf'%string.lower(serverName)
13 >        if 'server_' in string.lower(serverName):
14 >            self.configFileName = '%s.conf'%string.lower(serverName)
15 >        else:
16 >            self.configFileName = 'server_%s.conf'%string.lower(serverName)
17 >
18          localCfg = self.getConfig_()
19  
20          # parse the localCfg file
# Line 29 | Line 33 | class ServerConfig:
33      def downloadFile(self, url, destination):
34          try:
35              f = urllib.urlopen(url)
36 +            data = f.read()
37 +            if '<!' in data[:2]:
38 +                raise IOError
39 +
40              ff = open(destination, 'w')
41 <            ff.write(f.read())
41 >            ff.write(data)
42              ff.close()
43          except IOError:
44              raise CrabException('Cannot download config file '+destination+' from '+self.url)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines