140 |
|
pass |
141 |
|
|
142 |
|
self.cfg_params_dataset = {} |
143 |
< |
common_opts = [] |
143 |
> |
common_opts = {} |
144 |
|
# first get common sections |
145 |
|
for sec in self.cfg_params: |
146 |
|
if sec in ['MULTICRAB']: |
147 |
|
cfg_common=self.cfg_params[sec] |
148 |
|
continue |
149 |
|
if sec in ['COMMON']: |
150 |
< |
common_opts.append(self.cfg_params[sec]) |
150 |
> |
common_opts=self.cfg_params[sec] |
151 |
|
continue |
152 |
|
pass |
153 |
|
|
156 |
|
if sec in ['MULTICRAB', 'COMMON']: continue |
157 |
|
self.cfg_params_dataset[sec]=self.cfg_params[sec] |
158 |
|
# add common to all dataset |
159 |
< |
for opt in common_opts: |
160 |
< |
self.cfg_params_dataset[sec]=opt |
159 |
> |
for key in common_opts: |
160 |
> |
self.cfg_params_dataset[sec][key]=common_opts[key] |
161 |
|
pass |
162 |
|
|
163 |
|
self.cfg=cfg_common['cfg'] |
164 |
|
|
165 |
+ |
# read crab.cfg file and search for storage_path |
166 |
+ |
cfg_params = loadConfig(self.cfg,{}) |
167 |
+ |
self.storage_path = cfg_params.get("USER.storage_path",None) |
168 |
|
return |
169 |
|
|
170 |
|
def loadMultiConfig(self, file): |
195 |
|
for opt in self.cfg_params_dataset[sec]: |
196 |
|
tmp="-"+string.upper(opt.split(".")[0])+"."+opt.split(".")[1] |
197 |
|
options[tmp]=self.cfg_params_dataset[sec][opt] |
198 |
+ |
# add section to storage_path if exist in crab.cfg |
199 |
+ |
if self.storage_path: |
200 |
+ |
options["-USER.user_remote_dir"]=self.storage_path+"/"+sec |
201 |
|
# Input options (command) |
202 |
|
for opt in self.opts: |
203 |
|
options[opt]=self.opts[opt] |
204 |
|
try: |
205 |
< |
# print options |
205 |
> |
#print options |
206 |
|
crab = Crab(options) |
207 |
|
crab.run() |
208 |
|
common.apmon.free() |