16 |
|
PrimaryDataset = ProcessedDataset |
17 |
|
if PrimaryDataset != '': |
18 |
|
if ( PrimaryDataset[0] == '/' ): PrimaryDataset=PrimaryDataset[1:] |
19 |
< |
lfnbase = os.path.join(forced_path, getUserName(), PrimaryDataset, ProcessedDataset) |
19 |
> |
if forced_path.find('store/group')>0: |
20 |
> |
lfnbase = os.path.join(forced_path, PrimaryDataset, ProcessedDataset) |
21 |
> |
else: |
22 |
> |
lfnbase = os.path.join(forced_path, getUserName(), PrimaryDataset, ProcessedDataset) |
23 |
|
if (publish == True): |
24 |
+ |
checkSlash(ProcessedDataset) |
25 |
|
checkLength(lfnbase, forced_path, PrimaryDataset, ProcessedDataset) |
26 |
|
return lfnbase |
27 |
|
|
28 |
+ |
def checkSlash(ProcessedDataset): |
29 |
+ |
""" |
30 |
+ |
check if [USER].publish_data_name contains not allowed slash |
31 |
+ |
""" |
32 |
+ |
import re |
33 |
+ |
|
34 |
+ |
#if (str(ProcessedDataset).find("/") > -1): |
35 |
+ |
# raise CrabException("Warning: [USER] publication_data_name contains a '/' characters that is not allowed. Please change the publication_data_name value") |
36 |
+ |
m = re.findall("[^-\w_\.%]+", str(ProcessedDataset)) |
37 |
+ |
if (m != []): |
38 |
+ |
common.logger.debug("check not allowed characters in the publication_data_name = " + str(m)) |
39 |
+ |
raise CrabException("Warning: [USER] publication_data_name contains not allowed characters %s . Please change the publication_data_name value" % str(m)) |
40 |
+ |
|
41 |
|
def checkLength(lfnbase, forced_path, PrimaryDataset, ProcessedDataset): |
42 |
|
""" |
43 |
|
""" |