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: |
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 |
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): |