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

Comparing COMP/CRAB/python/WorkSpace.py (file contents):
Revision 1.30 by slacapra, Mon Sep 22 17:06:15 2008 UTC vs.
Revision 1.31 by spiga, Fri Mar 6 18:37:32 2009 UTC

# Line 1 | Line 1
1   from crab_exceptions import *
2   #from threading import RLock
3   import common
4 < import os, shutil, string, time, commands
4 > import os, shutil, string, time
5 > from crab_util import getUserName
6   #from crab_logger import Logger
7  
8   class WorkSpace:
# Line 30 | Line 31 | class WorkSpace:
31          #self._pathForTgz = string.split(top_dir, '/')[-1]
32          self._pathForTgz = self._share_dir
33  
34 <        self.uuid = commands.getoutput('uuidgen')
34 >        self.uuid = self.uuidGen()
35 >
36 >    def uuidGen(self):
37 >        import random
38 >
39 >        letters = "abcdefghijklmnopqrstuvwxyz"
40 >        numbers = "0123456789"
41 >        genid_bits = random.sample(letters, 3) + random.sample(numbers, 3)
42 >        random.shuffle(genid_bits)
43 >        combination = ''.join(genid_bits)
44 >
45 >        return combination  
46  
47      def create(self):
48          # Matteo change in order to ban only "data" in "CMSSW" dir and
# Line 118 | Line 130 | class WorkSpace:
130          
131      def taskName(self):
132  
133 <        self.taskName_=os.environ['USER'] + '_' + string.split(common.work_space.topDir(),'/')[-2]+'_'+self.uuid
133 >        user_name = getUserName()
134 >        self.taskName_= user_name + '_' + string.split(common.work_space.topDir(),'/')[-2]+'_'+self.uuid
135 >
136          return self.taskName_
137  
138      def setResDir(self, dir):

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines