1 |
|
from crab_exceptions import * |
2 |
|
#from threading import RLock |
3 |
|
import common |
4 |
– |
|
4 |
|
import os, shutil, string, time |
5 |
+ |
#from crab_logger import Logger |
6 |
|
|
7 |
|
class WorkSpace: |
8 |
|
def __init__(self, top_dir, cfg_params): |
9 |
– |
self._cwd_dir = os.getcwd()+'/' |
9 |
|
|
10 |
< |
self._top_dir = top_dir # top working directory |
10 |
> |
self._cwd_dir = os.getcwd()+'/' |
11 |
> |
self._top_dir = top_dir # top working directory |
12 |
|
|
13 |
|
#Matteo: Necessary to manage user ui_working_dir |
14 |
|
if 'USER.ui_working_dir' in cfg_params.keys(): |
26 |
|
|
27 |
|
self._boss_cache = self._share_dir + '/.boss_cache' |
28 |
|
|
29 |
– |
|
29 |
|
try: |
30 |
|
self.outDir = cfg_params["USER.outputdir"] |
31 |
|
except: |
37 |
|
return |
38 |
|
|
39 |
|
def create(self): |
40 |
< |
if (string.split(self._top_dir,'/')[-2]=='data'): |
40 |
> |
# Matteo change in order to ban only "data" in "CMSSW" dir and |
41 |
> |
# not crash when short path is given |
42 |
> |
subpath = self._top_dir.split('CMSSW') |
43 |
> |
if len(subpath)!=1 and len(subpath[-1].split("data"))!=1: |
44 |
|
msg = 'Cannot run CRAB from "data" directory.\n' |
45 |
|
msg += 'please change direcotry\n' |
46 |
|
raise CrabException(msg) |
47 |
|
|
48 |
+ |
# if (string.split(self._top_dir,'/')[-2]=='data'): |
49 |
+ |
# msg = 'Cannot run CRAB from "data" directory.\n' |
50 |
+ |
# msg += 'please change direcotry\n' |
51 |
+ |
# raise CrabException(msg) |
52 |
+ |
|
53 |
|
|
54 |
|
if not os.path.exists(self._top_dir): |
55 |
|
os.mkdir(self._top_dir) |